我使用jvm参数启动了树脂3.0.28:
-Xms6300M -Xmx6300M -Xss128k -XX:ThreadStackSize=256 -XX:MaxPermSize=128M
-XX:PermSize=128M -verbose:gc -XX:+PrintGCDetails -XX:+UseParallelGC
-XX:+PrintGCTimeStamps
但保留的内存已超过10GB
树脂有什么问题? 我使用jmap -heap,输出如下: 它表明jvm堆内存处于正常状态。
Attaching to process ID 9456, please wait... Debugger attached successfully. Server compiler detected. JVM version is 10.0-b22 using thread-local object allocation. Parallel GC with 16 thread(s) Heap Configuration: MinHeapFreeRatio = 40 MaxHeapFreeRatio = 70 MaxHeapSize = 6606028800 (6300.0MB) NewSize = 2686976 (2.5625MB) MaxNewSize = -65536 (-0.0625MB) OldSize = 5439488 (5.1875MB) NewRatio = 2 SurvivorRatio = 8 PermSize = 134217728 (128.0MB) MaxPermSize = 134217728 (128.0MB) Heap Usage: PS Young Generation Eden Space: capacity = 2155151360 (2055.3125MB) used = 1966086568 (1875.0062637329102MB) free = 189064792 (180.30623626708984MB) 91.22730795112228% used From Space: capacity = 23265280 (22.1875MB) used = 13849352 (13.207771301269531MB) free = 9415928 (8.979728698730469MB) 59.527983329665496% used To Space: capacity = 23068672 (22.0MB) used = 0 (0.0MB) free = 23068672 (22.0MB) 0.0% used PS Old Generation capacity = 4404019200 (4200.0MB) used = 3854164456 (3675.6176528930664MB) free = 549854744 (524.3823471069336MB) 87.51470602126349% used PS Perm Generation capacity = 134217728 (128.0MB) used = 53393152 (50.919677734375MB) free = 80824576 (77.080322265625MB) 39.78099822998047% used
答案 0 :(得分:0)
你到底保留了什么?我假设您指的是进程本身分配的内存:
堆将不会使用超过您指定的数量(除了一些碎片,但这是次要的)。过程中的“其他物体”使用这个空间,虽然树脂或JVM可能有问题,特别是如果内存在数周内稳定增加,树脂和hvm使用的内存量也可能是正常的。 / p>
看看我尝试回答另一个类似的问题:
JVM memory consumption double of heapsize
简而言之:确保您查看正确的工艺尺寸。我通常在32位Debian系统上使用1-1.5 GB的非Java堆空间用于树脂(这当然会使你的4 GB声音很多)。
此外:
-Xss128k -XX:ThreadStackSize = 256
将被解释为
-XX:ThreadStackSize = 128 -XX:ThreadStackSize = 256,
所以你可能想要删除其中一个......(见http://mail.openjdk.java.net/pipermail/hotspot-dev/2011-June/004272.html)