100% CPU every 5 seconds?

511 views
Skip to first unread message

Maze

unread,
Dec 3, 2014, 5:47:58 PM12/3/14
to ope...@googlegroups.com

Running OH 1.6.1 on Win 7. Every 5 seconds the CPU load will jump up to 100% as long as OH is running. I had the same problem with version 1.5. There are no entries in the debug log that can be traced to run every 5 seconds.

Anyone have any idea what could be the reason for this ?

Running following bindings




Mario Hoffmann

unread,
Dec 4, 2014, 5:31:58 AM12/4/14
to ope...@googlegroups.com
Hi,

since 1.6.1 i've got the same.

load average: 2,93, 2,77, 2,71

Addons :

org.openhab.action.mail-1.6.1.jar
org.openhab.action.nma-1.6.1.jar
org.openhab.action.xbmc-1.6.1.jar
org.openhab.binding.asterisk-1.6.1.jar
org.openhab.binding.astro-1.6.1.jar
org.openhab.binding.exec-1.6.1.jar
org.openhab.binding.http-1.6.1.jar
org.openhab.binding.knx-1.6.1.jar
org.openhab.binding.mpd-1.6.1.jar
org.openhab.binding.mqtt-1.6.1.jar
org.openhab.binding.mqttitude-1.6.1.jar
org.openhab.binding.networkhealth-1.6.1.jar
org.openhab.binding.ntp-1.6.1.jar
org.openhab.binding.onkyo-1.6.1.jar
org.openhab.binding.rfxcom-1.6.1.jar
org.openhab.binding.snmp-1.6.1.jar
org.openhab.binding.systeminfo-1.6.1.jar
org.openhab.binding.tcp-1.6.1.jar
org.openhab.binding.vdr-1.6.1.jar
org.openhab.binding.weather-1.6.1.jar
org.openhab.binding.wol-1.6.1.jar
org.openhab.binding.xbmc-1.6.1.jar
org.openhab.io.cv-1.6.1.jar
org.openhab.persistence.rrd4j-1.6.1.jar

Kai Kreuzer

unread,
Dec 4, 2014, 5:33:56 AM12/4/14
to ope...@googlegroups.com
Can anyone of you identify the culprit?
I would expect that the core runtime without any extension works smoothly. So it must be some add-on that causes the problems.

Regards,
Kai

--
You received this message because you are subscribed to the Google Groups "openhab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
For more options, visit https://groups.google.com/d/optout.

Eugene Schava

unread,
Dec 4, 2014, 6:55:39 AM12/4/14
to ope...@googlegroups.com
You can try HotThread utility from https://weblogs.java.net/blog/brucechapman/archive/2008/03/hot_threads.html to identify thread eathing the CPU
Very useful tool

Четвер, 4 грудня 2014 р. 00:47:58 UTC+2 користувач Maze написав:

dan cunningham

unread,
Dec 4, 2014, 10:39:07 AM12/4/14
to ope...@googlegroups.com
On linux this can be done fairly easily using top and taking a thread dump of openhab.  First step is to find the offending thread, from the command line run "top -H". this puts top into Threads-mode operation and will list each thread.  Once you find the java process/thread copy the PID value and convert it to HEX (hint just google "xxxxx in hex" where xxx is your pid).  Next we need to take a thread dump of openhab.  Find the PID of openhab ( ps aux |grep java) and run kill -QUIT xxx (or kill -3 xxx, same thing) where xxx is your pid.  This will send a signal to the java process to take a thread dump and print it to standard out. From this output find the hex value converted earlier.  

Max Stephan

unread,
Dec 4, 2014, 11:03:37 AM12/4/14
to ope...@googlegroups.com
Hi Eugene,

HotThread seems no more available on the link you posted, is there another source for it ?


Thx,
Max

Eugene Schava

unread,
Dec 4, 2014, 11:13:08 AM12/4/14
to ope...@googlegroups.com
Attached copy of that file downloaded some time ago


-----------------
Thanks,
Eugene

--
You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/IlHV4wBCo60/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.
HotThread.jar

Eugene Schava

unread,
Dec 4, 2014, 11:19:24 AM12/4/14
to ope...@googlegroups.com
Attached copy of that file downloaded some time ago

Четвер, 4 грудня 2014 р. 18:03:37 UTC+2 користувач Max Stephan написав:
HotThread.jar

Mario Hoffmann

unread,
Dec 5, 2014, 2:51:04 AM12/5/14
to ope...@googlegroups.com
I have made an Thread Dump.

I can't read this ;-(
Dump_05122014.txt

dan cunningham

unread,
Dec 5, 2014, 10:22:48 AM12/5/14
to ope...@googlegroups.com
Are you on Linux?  If so, can you first run "top -H" and see which PID is consuming the cpu then run a thread dump, post both back here, thanks.

Sent from my iPad

On Dec 4, 2014, at 11:51 PM, Mario Hoffmann <mssn.h...@gmail.com> wrote:

I have made an Thread Dump.

I can't read this ;-(

--
You received this message because you are subscribed to the Google Groups "openhab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab+u...@googlegroups.com.

To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
For more options, visit https://groups.google.com/d/optout.
<Dump_05122014.txt>

Maze

unread,
Dec 5, 2014, 2:45:51 PM12/5/14
to ope...@googlegroups.com
What can I do If I'am on Windows?

dan cunningham

unread,
Dec 5, 2014, 5:16:46 PM12/5/14
to ope...@googlegroups.com
I have not tried this, but give this a shot:

Same thing, find the PID number under the threads tab of the offending process and then take a thread dump

Maze

unread,
Dec 6, 2014, 5:59:17 AM12/6/14
to ope...@googlegroups.com
The Process Explorer did not give me any more information in this case. I already know that the java.exe process is the one to "blame" and was hoping for a way to see what thread or process inside java.exe causing the problem.

Mario Hoffmann

unread,
Dec 6, 2014, 1:42:42 PM12/6/14
to ope...@googlegroups.com
Hi, on my Side it was following Thread

"fileinstall-addons" daemon prio=10 tid=0x00007f769c468800 nid=0x1302 in Object.wait() [0x00007f76af055000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x00000000c6d0da78> (a org.apache.felix.fileinstall.internal.DirectoryWatcher)
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:296)
        - locked <0x00000000c6d0da78> (a org.apache.felix.fileinstall.internal.DirectoryWatcher)


And this fixed it :

dan cunningham

unread,
Dec 6, 2014, 3:38:48 PM12/6/14
to ope...@googlegroups.com
So I'm not familiar with the windows tool, but according to an Oracle support page, this tool allows you to see which thread is eating the CPU (under the threads tab).  If you could report that along with a thread dump we can correlate the two.  It will probably show more then one java.exe under this tab.

Maze

unread,
Dec 7, 2014, 2:58:18 AM12/7/14
to ope...@googlegroups.com
Ok. Now I am out in deep water but I think this is what you talking about. What I understand there is only one java process runing on my computer at the moment. If I check the properties of that process I can see 81 active threads. All but two are "msvcr100.dll!endthreadex+0x80". The remaining threads are "java.exe+0x855a" and" java.exe+0xa627". These two have a CPU load of <0.01%.

One of the "msvcr100.dll!endthreadex+0x80" threads have a periodic CPU load that change between 2% and 85%. This is the dump of that thread:

zip.dll!ZIP_Open+0x44da
zip.dll!ZIP_Open+0x4889
zip.dll!ZIP_Open+0x4ada
zip.dll!ZIP_Open+0xe18
zip.dll!Java_java_util_zip_Deflater_deflateBytes+0x21b
jvm.dll!JVM_Clone+0x4358a
jvm.dll!JVM_FindSignal+0x62e1e
jvm.dll!JVM_Clone+0x43755
jvm.dll!JVM_Clone+0x437b7
jvm.dll!jio_printf+0xaf
jvm.dll!JVM_Clone+0x648fc
jvm.dll!JVM_Clone+0x65357
jvm.dll!JVM_FindSignal+0x4d29
msvcr100.dll!endthreadex+0x3a
msvcr100.dll!endthreadex+0xe4
kernel32.dll!BaseThreadInitThunk+0x12
ntdll.dll!RtlInitializeExceptionChain+0xef
ntdll.dll!RtlInitializeExceptionChain+0xc2

Maze

unread,
Dec 7, 2014, 3:02:00 AM12/7/14
to ope...@googlegroups.com
Thank you for the infrmation and the link. It solved the problem for me too. Now OH have en average CPU load of 2-3% after I moved the "not used" folder.

Kevin Gottsman

unread,
Jan 4, 2015, 3:01:06 PM1/4/15
to ope...@googlegroups.com
All,

I followed DigitalDan's recommendation and found that this was the culprit thread in my situation. I currently have high load and its consuming lots of memory. This occurs after running openhab for a few hours/days. If I recycle OH, it returns to normal.

Could it be a binding calling the SSL library? Not sure how to read the thread dump.... I included the actual thread dump and the top screenshots.

OH 1.5.1
java 1.7_71
Centos 7 w/ 2 cores

"Thread-45" daemon prio=10 tid=0x00007f1ab01e9000 nid=0x2c7d runnable [0x00007f1a751b8000]
   java.lang.Thread.State: RUNNABLE
at sun.security.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:796)
at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:758)
- locked <0x00000000e3eb0d28> (a java.lang.Object)
at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:624)
at org.java_websocket.SSLSocketChannel2.unwrap(SSLSocketChannel2.java:150)
- locked <0x00000000e3e9c768> (a org.java_websocket.SSLSocketChannel2)
at org.java_websocket.SSLSocketChannel2.readRemaining(SSLSocketChannel2.java:254)
at org.java_websocket.SSLSocketChannel2.readMore(SSLSocketChannel2.java:321)
at org.java_websocket.SocketChannelIOHelper.readMore(SocketChannelIOHelper.java:28)
at org.java_websocket.client.WebSocketClient.interruptableRun(WebSocketClient.java:238)
at org.java_websocket.client.WebSocketClient.run(WebSocketClient.java:188)
at java.lang.Thread.run(Thread.java:745)
openhab-thread-dump.log
top.rtf

Peter Boehm

unread,
Jan 5, 2015, 11:45:49 AM1/5/15
to ope...@googlegroups.com
Hi Kevin,

Same here at my side.

I have 3 processes running at a very high cpu load:

62F, 4C79 and 5A87

Each of them is "associated" to "org.java_websocket.SSLSocketChannel2".

After a OH reload everything is running o.k. for 3 or 4 days.

All the best

Peter
dump.txt

Kevin Gottsman

unread,
Jan 5, 2015, 1:55:01 PM1/5/15
to ope...@googlegroups.com
Peter,

The only thing that I have that running with SSL (I believe) is the
my.openhab cloud binding. I don't have any OH security turned on at the
moment. Are you using that one as well?


-- Kevin
> <https://lh6.googleusercontent.com/--m4zCxzkzeM/VH-SKMdyQuI/AAAAAAAAC0w/NXnVFWkbKC0/s1600/Capture1.PNG>
>
>
>
> <https://lh4.googleusercontent.com/-EnZG6_U1pp8/VH-R3t3uASI/AAAAAAAAC0o/tGxLCqgfP7I/s1600/Capture.PNG>
>
>
> --
> You received this message because you are subscribed to the
> Google Groups "openhab" group.
> To unsubscribe from this group and stop receiving emails
> from it, send an email to openhab+u...@googlegroups.com.
> To post to this group, send email to ope...@googlegroups.com.
> Visit this group at http://groups.google.com/group/openhab
> <http://groups.google.com/group/openhab>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "openhab" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to openhab+u...@googlegroups.com
> <mailto:openhab+u...@googlegroups.com>.
> To post to this group, send email to ope...@googlegroups.com
> <mailto:ope...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/openhab/149803b7-9183-4648-bc3f-95845ec7c9df%40googlegroups.com
> <https://groups.google.com/d/msgid/openhab/149803b7-9183-4648-bc3f-95845ec7c9df%40googlegroups.com?utm_medium=email&utm_source=footer>.

Peter Boehm

unread,
Jan 6, 2015, 6:43:04 AM1/6/15
to ope...@googlegroups.com
Hi Kevin,

Yes I also use my.openhab but have disabled it for testing. This binding has no effect on the cpu load issue.

According to lsof (lsof -i | grep -e LISTEN) my system has the following connections opened by my java process:

java     16870 root  123u  IPv6 100702      0t0  TCP *:5555 (LISTEN)
java     16870 root  129u  IPv6 100703      0t0  TCP *:http-alt (LISTEN)
java     16870 root  139u  IPv6 100706      0t0  TCP *:8443 (LISTEN)
java     16870 root  164u  IPv6 153697      0t0  TCP *:45367 (LISTEN)

 8443 is a ssl secured jetty process and 45367 is a rmi process. So I guess it must be one of these processes.

Hmmm, while I am typing this I am thinking about the netatmo process. Maybe this one openes an ssl secured connections. I have to check this.

peter
Reply all
Reply to author
Forward
0 new messages