如何查看 JVM 中的 MaxPermSize?
grails.tomcat.jvmArgs = ["-Xmx1024m", "-XX:MaxPermSize=1024m"]
有谁知道如何查看JVM实际应用的MaxPermSize?
I'm meeting the dreadful PermGen:Out of memory error when deploying a web-app on TomCat. I have tried many possible solutions, but they don't work out(sometimes it works, usually it doesn't). I wonder if my config in "BuildConfig.groovy" take effect:
grails.tomcat.jvmArgs = ["-Xmx1024m", "-XX:MaxPermSize=1024m"]
Does anyone know someway to view the MaxPermSize actually applied by the JVM?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在直接回答你的问题时,java.lang.management.ManagementFactory有方法获取java使用的所有内存池的信息,包括PermGen空间和其他非堆内存池:
In direct answer to your question, java.lang.management.ManagementFactory has method to get information on all of the memory pools used by java, including the PermGen space and other non-heap memory pools:
您可以在 JDK/bin 中使用 JVisualVM目录来监视有关 java 进程的所有内容。
You can use JVisualVM in the JDK/bin directory to monitor everything about a java process.
我相信 jsdk 中有几个实用程序 - 尝试 jstat -gcpermcapacity。另一个有时有用的技巧是 ps -fwwwC java (假设您在 Linux 机器上运行它)
There's a couple of utilities that come in the jsdk i believe - try jstat -gcpermcapacity. Another trick that can sometimes be helpful is ps -fwwwC java (assuming you are running this on a linux box)