内存转储比可用内存小得多
我有一个 Tomcat 应用程序服务器,配置为在 OOM 上创建内存转储,并且以 -Xmx1024M 启动,因此应该有千兆字节可供他使用。
现在我找到了一个这样的转储,它只包含 260MB 的未保留内存。垃圾场怎么可能比他应有的可用大小小得多?
I have a Tomcat Application Server that is configured to create a memory dump on OOM, and it is started with -Xmx1024M, so a Gigabyte should be available to him.
Now I found one such dump and it contains only 260MB of unretained memory. How is it possible that the dump is so much smaller than the size he should have available?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Permgen 空间的管理独立于堆,即使总体上有足够的可用内存,也可能会耗尽。一些 Web 框架(尤其是 JSF)非常消耗资源,而且很容易导致默认配置耗尽。可以使用 -XX:MaxPermSize=###m 来增加它,
请记住,系统空间受到堆和永久生成器总和的限制,因此,如果不这样做,在开始出现“无法创建本机线程 OOM”异常之前,您可以消耗更少的总资源。 t 将堆减少 PermGen 增加的量。
Permgen space is managed independently of the heap and can run out even when there's plenty of free memory overall. Some web frameworks (especially JSF) are real hogs and while easily cause the default config to run out. It can be increased with -XX:MaxPermSize=###m
Remember the system space is constrained by the sum of heap and permgen, so you can consume fewer total resources before you start getting the Cannot Create Native Thread OOM exception if you don't decrease heap by the amount PermGen is increased.
只有有关已分配内存的使用情况的信息才会转储到文件中。
堆转储不是堆的二进制映像,它包含有关数据类型等的信息,并且可能超出您的可用内存。
文本(经典)Heapdump 文件格式
Only information about the usage of allocated memory will be dumped to a file.
A heap dump isn't a binary image of your heap, it contains information about data types etc. and may exceed your available memory.
Text (classic) Heapdump file format