Re: Something is killing my CPU

Ronald Roskens <[email protected]> Mon, 8 Oct 2018 13:05:35 -0500
Newsgroups gmane.network.opennms.general
Message-ID <[email protected]>

> On Oct 8, 2018, at 9:23 AM, Gavin Hill <[email protected]> wrote:
> 
> How do I identify which OpenNMS (22.0.4) process is consuming all of my CPU time?  I have a 4-core machine that runs fine after a restart but over time, CPU just grows until it maxes out.
>  
> <image001.png>
>  
> <image002.png>
>  
> Any thoughts on how I identify what is doing this?  I look in htop and it shows it’s one of the OpenNMS Java threads, but I don’t know how to find out which.  Restarting OpenNMS every few days is not an option for me.


You can use either “jstack $PID” or “kill -3 $PID” to get a stack trace out from java. The kill -3 sends the output into output.log.

Convert the top thread from decimal to hex, and then search the stack trace output for nid=0x$hex.

Here is an example thread output from a random java process on my machine just to show you what to look for. I’d give you one from OpenNMS, but I don’t have access to one now.

"File Watcher" #34 daemon prio=1 os_prio=31 tid=0x00007f830edb8000 nid=0x1e203 waiting on condition  [0x0000700008b8f000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park([email protected]/Native Method)
	- parking to wait for  <0x0000000780c04518> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park([email protected]/LockSupport.java:194)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await([email protected]/AbstractQueuedSynchronizer.java:2075)
	at java.util.concurrent.LinkedBlockingQueue.take([email protected]/LinkedBlockingQueue.java:435)
	at org.netbeans.modules.masterfs.watcher.macosx.OSXNotifier.nextEvent(OSXNotifier.java:85)
	at org.netbeans.modules.masterfs.providers.Notifier$1.nextEvent(Notifier.java:99)
	at org.netbeans.modules.masterfs.watcher.Watcher$Ext.run(Watcher.java:322)
	at java.lang.Thread.run([email protected]/Thread.java:844)

Ron

_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-discuss mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-discuss