树脂内存问题
我使用jvm参数启动了resin 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
I started the resin 3.0.28 using the jvm parameter :
-Xms6300M -Xmx6300M -Xss128k -XX:ThreadStackSize=256 -XX:MaxPermSize=128M
-XX:PermSize=128M -verbose:gc -XX:+PrintGCDetails -XX:+UseParallelGC
-XX:+PrintGCTimeStamps
but the memory retained has been over 10GB
What's wrong with the resin?
I use jmap -heap and the output is as below:
it shows that jvm heap memory is in normal state.
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的“记忆保留”到底是什么意思?我假设您的意思是进程本身分配的内存:
堆不会使用比您指定的更多的内存(除了一些碎片,但这是次要的)。进程中的“其他对象”使用这个空间,尽管resin或JVM可能有问题,特别是如果内存在数周内稳定增加,resin和hvm使用的内存量也可能是正常的。
看看我尝试回答另一个类似的问题:
JVM 内存消耗是堆大小的两倍
简而言之:确保您查看的是正确的进程大小。我通常在 32 位 Debian 系统上为树脂分配 1-1.5 GB 的非 java 堆空间(这当然会让你的 4 GB 听起来很多)。
此外:
-Xss128k -XX:ThreadStackSize=256
将被解释为
-XX:ThreadStackSize=128 -XX:ThreadStackSize=256,
因此您可能需要删除其中之一... openjdk.java.net/pipermail/hotspot-dev/2011-June/004272.html" rel="nofollow noreferrer">http://mail.openjdk.java.net/pipermail/hotspot-dev/2011-June/004272.html)
What exactly do you mean my "memory retained"? I will assume that you mean the memory allocated by the process itself:
The heap won't use more than you specify (apart from some fragmentation, but that's minor). "Other objects" in the process use this space, Although there could be something wrong with resin or the JVM, especially if the memory is ever increasing steadily over weeks, the amount of memory used by resin and the hvm could also be normal.
Have a look at my attempt to answer another similar question:
JVM memory consumption double of heapsize
In short: Make sure your looking at the correct process size. I typically se 1-1.5 GB of non java-heap space for resin on a 32-bit Debian system (which of course make your 4 GB sound a lot).
Furthermore:
-Xss128k -XX:ThreadStackSize=256
will be interpreted as
-XX:ThreadStackSize=128 -XX:ThreadStackSize=256,
so you might want to remove one of them... (see http://mail.openjdk.java.net/pipermail/hotspot-dev/2011-June/004272.html)