我经常在 IBM Websphere Application Server 上发现 OutOfMemoryException。 我认为发生此异常是因为我的应用程序从数据库中检索了大量数据。所以,我限制所有查询不要检索超过 1000 条记录的数据,并设置 WAS 的 JVM 跟随
+ Verbose garbage collection
+ Maximum Heap size = 1024 (RAM on my server is 16 GB and now I already change to 8192)
+ Debug arguments = -Djava.compiler=NONE -Xdebug -Xnoagent
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7777
+ Generic JVM arguments = -Dsun.rmi.dgc.server.gcInterval=60000
-Dsun.rmi.dgc.client.gcInterval=60000 -Xdisableexplicitgc
-Dws.log=E:\WebApp\log -Dws.log.level=debug
(ws.log and ws.log.level are my properties)
而且我在配置文件文件夹中找到了heapdump、javacore 和snap 文件,我认为它们可以告诉我问题的原因,但我不知道不知道如何读取/使用 heapdump、javacore 和 snap 文件。
请告诉我如何防止/避免/修复 OutOfMemoryException。 谢谢
最佳答案
如果您想查看堆转储文件,IBM 提供了分析它们的工具 here .
关于java - IBM Websphere 内存不足异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/182876/