I have s.t. like a infinite loop some where in the code. That place is somehow not called often. So after a couple of hours one of the CPU's on the Linux machine start's running at 100% then after a while another one etc. Restarting the server solves the problem for a while.
How can i find the place where this happens?
I thought about setting the RequestTimeout very small. (5 min) Would I get a proper error message in the log that tells me what's wrong.
top with command "H"
16639 java 20 0 9836m 2.6g 17m R 100 16.5 39:55.33 java 18059 java 20 0 2745m 2.3g 17m S 2 14.5 0:00.92 java 16591 java 20 0 9836m 2.6g 17m S 1 16.5 0:15.97 java 5307 java 20 0 8945m 4.6g 3864 S 1 29.1 746:47.67 java
and then: jstack -J-d64 16639
But I get: 16639: Unable to open socket file: target process not responding or HotSpot VM not loaded The -F option can be used when the target process is not responding
Must I start s.t. on the machine before?
Nice article about how to search for the hotspot:
http://code.nomad-labs.com/2010/11/18/identifying-which-java-thread-is-consuming-most-cpu/