Clear Java Heap Bottleneck - How to Determine the Cause?

I have a J2EE project running on JBoss with a maximum heap size of 2048 m that gives strange results in stress testing. I compared the use of heap and processor and got the following results (series 1 - use of heap, series 2 - use of processor):

http://i29.tinypic.com/m9ul1e.png

It seems like the heap is being used properly and getting garbage collected properly around A. When it gets to B, there seems to be some kind of bottleneck as there is heap space, but it never breaks this imaginary line. At the same time, in C, processor usage drops sharply. During this period, we also get "OutOfMemoryError (GC upper limit exceeded)", which doesn’t make much sense to me, since there is room for heap.

I suppose there is some kind of bottleneck, but which I can’t even imagine. How would you advise finding the cause of the problem? I profiled memory usage and noticed that there are quite a few instances of the same class (about a million), but the total size of these instances is quite small (about 50 MB, if I remember correctly).

Edit: The server is intended for this application, and CPU usage is used only for the JVM (there should not be significant CPU usage outside the JVM). Memory usage is for heap only, it does not include permg space. This problem is reproducible. My main concern is to limit the limit that occurs around B, for which I have not yet found a plausible explanation.

Conclusion . It turns out that this is caused by the simultaneous invocation of long SQL queries. The returned ResultSets were also very large, possibly explaining OOME. I still don't have a reasonable explanation of why there is some limit in B.

+3
source share
2

, JVM . OOME, GC, .

Sun , 98% , 98% . , ( ):

  • JVM , , - , .
  • , , ( ) JVM , , .

(, ), . , , ( ) , ( , ).

, , GC, GC.

: , , (.. ), GC .

+2

, " ", . , . .

, , , ( , ).

0

Source: https://habr.com/ru/post/1756550/


All Articles