显示分配堆栈跟踪时防止程序崩溃 [英] Prevent program from crashing when showing allocation stack traces

查看:91
本文介绍了显示分配堆栈跟踪时防止程序崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题

为什么VisualVM在尝试查看对象分配堆栈跟踪时终止我的程序,我该如何解决?

Why does VisualVM terminate my program when attempting to view object allocation stack trace, and how do I fix it?

我正在清理一个有一些内存问题的应用程序,最大的就是创建了一堆短暂的 int [] 这导致GC像疯了一样开火:

I'm cleaning up an application which has a few memory problems, the biggest being creating a bunch of short-lived int[] which causes GC to fire like crazy:

当我右键单击 int [] 并选择拍摄快照并显示分配堆栈跟踪 ,我的应用程序关闭,弹出一个警告框,说无法获取结果快照。申请已终止

When I right click int[] and choose Take Snapshot and Show Allocation Stack Traces, my application closes and a warning box pops up saying Failed to obtain results snapshot. The application terminated:


我在这个问题上找到的最接近的是一个错误报告建议使用 -Xnoclassgc 运行我的配置文件应用程序。它不起作用,结果是一样的。

The closest thing I found on the subject was a bug report which recommended running my profiled application with -Xnoclassgc. It didn't work, the results were the same.

规格

VisualVM: 1.8.0_60 (Build 1380-140910); platform 20140910-unknown-revn
Java: 1.8.0_60; Java HotSpot(TM) 64-Bit Server VM (25.60-b23, mixed mode)
Eclipse: Luna Release (4.4.0) Build id: 20140612-0600
System: Windows 7 (6.1) Service Pack 1, amd64 64bit






崩溃日志

http://pastebin.com/a4YPWutj

崩溃日志的大小超出了字符数限制,因此我不得不将其放在其他位置。对不起。

推荐答案

好的。因此,基于获得的崩溃日志,您看起来遇到了已在此处报告的 VisualVM错误

Ok. So based on the crashlog obtained, it looks like you ran into a VisualVM bug already reported here:

JVM被分析崩溃

原始bug的提交者缩小了这个范围行为直到Java8,所以最好的机会是在较旧的(Java7)运行时上运行VisualVM。如果这是您的选项,那么您只需要下载Java7 JDK并直接从那里运行VisualVM。

The submitter of the original bug narrowed this behavior down to Java8, so the best chance you have is running a VisualVM on an older (Java7) runtime. If this is an option for you, then you only need to download a Java7 JDK and run the VisualVM directly from there.

这篇关于显示分配堆栈跟踪时防止程序崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆