top | item 22845983

(no title)

haglin | 5 years ago

The JDK comes with a powerful memory leak tool.

$ java -XX:StartFlightRecording:settings=profile MyApp

$ jcmd MyApp JFR.dump paths-to-gc-root=true filename=dump.jfr

$ jfr print --events OldObjectSample --stack-depth 64 dump.jfr

The tool will list objects on the heap, their path to the GC roots and allocation stack trace. That is usually sufficient to solve the memory leak. No need to create a large HPROF file or upload data to a server. Everything can be done in the shell.

https://docs.oracle.com/en/java/javase/13/troubleshoot/troub...

Sensitive information, like credit card numbers, will not even leave the Java heap.

discuss

order

No comments yet.