简体   繁体   中英

JProfiler - losing results on JVM OOM

Is it possible to make JProfiler not loose results when JVM exits? I'm trying to profile OOM, and as soon as JVM gets OOM, profiler looses all the data.

The profiling data lives in the profiling agent that runs inside the JVM process. If that process dies, the profiling information is gone. There is no way to save a JProfiler snapshot when an OOME occurs. 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. You can open HPROF snapshots in JProfiler.

  2. Add a "Heap usage threshold trigger" in JProfiler and set the threshold to something like 90%. A JProfiler snapshot will be saved at that threshold which should allow you to analyze a memory leak.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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