JVM memory issues

Please help me with the situation. I have CentOS with 4 GB of RAM with Tomcat configured with a memory capacity of 1500 MB. In some cases, my machine freezes when it reaches the maximum threads configured on it, i.e. 200. We must restart the application server for it to work again. The parameters are:

JAVA_OPTS="-server -Xss128k -Xms2048m -Xmx2048m -XX:MaxPermSize=512m -XX:NewRatio=3 -XX:SurvivorRatio=6 -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:CMSInitiatingOccupancyFraction=80 -Dfile.encoding=UTF8" 

Details of jvm mem are inserted below. Heap

  PSYoungGen    total 435456K, used 73027K [0x00000000e0c00000, 0x00000000fb580000, 0x0000000100000000) eden space 435200K, 16% used [0x00000000e0c00000,0x00000000e5350c70,0x00000000fb500000) from space 256K, 0% used [0x00000000fb540000,0x00000000fb540000,0x00000000fb580000) to  space 256K, 88% used [0x00000000fb500000,0x00000000fb538600,0x00000000fb540000) PSOldGen     total 741376K, used 132680K [0x00000000a2400000, 0x00000000cf800000, 0x00000000e0c00000) object space 741376K, 17% used [0x00000000a2400000,0x00000000aa592030,0x00000000cf800000) PSPermGen    total 22912K, used 22880K [0x0000000092400000, 0x0000000093a60000, 0x00000000a2400000) object space 22912K, 99% used [0x0000000092400000,0x0000000093a58088,0x0000000093a60000) Code Cache  [0x00002aaaab021000, 0x00002aaaab311000, 0x00002aaaae021000) total_blobs=1033 nmethods=670 adapters=317 free_code_cache=47372736 largest_free_block=12096 0x00002aaab41b7800 JavaThread ""http-apr-80"-exec-214" daemon [_thread_blocked, id=2636, stack(0x0000000043b06000,0x0000000043b27000)] 
+6
source share
1 answer

I do not think you have a memory problem.

I think you just ran out of available threads in the tomcat thread user pool .
Tomcat can no longer process requests if there are no free threads in its request processing thread pool to do another job and just waits until this situation changes (possibly forever).

I assume that at least one servlet / jsp of one of your web applications never terminates / does not return .

Take a stream dump to confirm this and easily identify the piece of software that causes it.

+4
source

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


All Articles