JVM 堆转储未引用的对象

发布于 2024-10-01 17:23:41 字数 319 浏览 7 评论 0原文

我有一个应用程序使用的短期对象比预期多得多,这导致了我需要解决的重大性能问题。为了让您了解问题的严重程度,Eden 空间在 10 秒内从大约 200mb 跃升至 1800mb,然后垃圾收集再次运行并使 Eden 恢复正常。我进行了两次堆转储,一次是在 GC 之后,一次是在下一次运行之前。我想分析这些并查看未引用的对象是什么,这样我就可以找到问题的根源,但是,当我将堆转储加载到 eclipse 或 netbeans 中时,两者似乎都删除了与未引用的对象关联的数据,并且仅显示当时应用程序中引用的对象有 200mb。有谁知道我可以分析堆转储以查看未引用对象是什么的工具/方法?

谢谢,

詹姆斯

I have an application that is using a lot more than expected short lived objects this is causing significant performance issues which I need to resolve. To give you an idea of the scale of the problem the Eden space jumps from around 200mb to 1800mb in 10 seconds before the garbage collection runs again and brings Eden right back down. I have taken 2 heap dumps one just after GC and one before the next run. I want to analyse these and see what the unreferenced objects are so I can find the source of the issue however, when I load the heap dumps in to either eclipse or netbeans both seems to remove the data associated with the unreferenced objects and just show the 200mb of referenced objects in the application at that time. Does anyone know of a tool/way for me to analyse the heap dump to see what the unreferenced objects are?

Thanks,

James

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

ゞ花落谁相伴 2024-10-08 17:23:41

上次我调试这样的问题时,我使用了 http://www.yourkit.com/ 这对我很有帮助。

Last time I debugged such problem I used http://www.yourkit.com/ that helped me very much.

也许可以在 Eclipse Memory Analyzer 可以帮助您。您还可以尝试按照常见问题解答中的说明启用 -keep_unreachable_objects

Maybe Unreachable Objects histogram available in Eclipse Memory Analyzer can help you. You may also try enabling -keep_unreachable_objects as stated on the FAQ.

淡淡的优雅 2024-10-08 17:23:41

我不知道有什么工具可以分析堆转储,但是 jdk 发行版附带的 jvisualvm有一个相当不错的内存分析器,我用它来调试类似的问题。它应该位于您的 jdk bin 目录中。

I don't know of a tool to analyze the heap dumps, but jvisualvm that comes with the jdk distribution has a rather nice memory profiler, that I've used to debug similar issues. It should be in your jdk bin-directory.

等数载,海棠开 2024-10-08 17:23:41

我已经能够使用 IBM Heap Analzyer 追踪到许多与堆相关的问题

但我猜您必须运行 IBM SDK 才能使用它,但也许值得一试?

I've been able to track down a lot of heap related issues with the IBM Heap Analzyer

But I guess you have to be running the IBM SDK to use it, but maybe it worth a shot?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文