简体   繁体   English

JProfiler - 在 JVM OOM 上丢失结果

[英]JProfiler - losing results on JVM OOM

Is it possible to make JProfiler not loose results when JVM exits?当 JVM 退出时,是否可以使 JProfiler 不丢失结果? I'm trying to profile OOM, and as soon as JVM gets OOM, profiler looses all the data.我正在尝试分析 OOM,一旦 JVM 得到 OOM,分析器就会丢失所有数据。

The profiling data lives in the profiling agent that runs inside the JVM process.分析数据位于在 JVM 进程内运行的分析代理中。 If that process dies, the profiling information is gone.如果该进程终止,则分析信息将消失。 There is no way to save a JProfiler snapshot when an OOME occurs.发生 OOME 时无法保存 JProfiler 快照。 Things you can do are你可以做的事情是

  1. Pass the通过

    -XX:+HeapDumpOnOutOfMemoryError

    VM parameter to the JVM in order to capture a HPROF heap snapshot exactly when the OOME occurs. JVM 的 VM 参数,以便在 OOME 发生时准确捕获 HPROF 堆快照。 You can open HPROF snapshots in JProfiler.您可以在 JProfiler 中打开 HPROF 快照。

  2. Add a "Heap usage threshold trigger" in JProfiler and set the threshold to something like 90%.在 JProfiler 中添加“堆使用阈值触发器”并将阈值设置为 90% 之类的值。 A JProfiler snapshot will be saved at that threshold which should allow you to analyze a memory leak. JProfiler 快照将保存在该阈值,这应该允许您分析 memory 泄漏。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM