简体   繁体   中英

Java - Automated CPU / Memory sampling - alternative to HPROF

I was used to work with HPROF in order to capture CPU time and memory usage while developing applications. For some reasons, I was forced to work with following JDK:

Eclipse OpenJ9 VM AdoptOpenJDK (build openj9-0.21.0, JRE 11 Windows 10 amd64-64-Bit Compressed References 20200715_679 (JIT enabled, AOT enabled)

Unfortunately, HPROF modules are not embedded with this JDK and I was wondering if there was any alternative to HPROF in order to perform some automatable profiling/sampling.

Actually, I'm interested in any CLI tool enabling to perform sampling/profiling and, if possible, generating files allowing to easily perform automated comparisons... Am I dreaming? :)

Any recommendation or suggestion will be welcomed !

Thanks for your help: :)

Instead of HPROF files, the OpenJ9 JVM creates PHD files (Portable Heap Dumps). Just like HPROF, PHD is only intended for memory profiling (the HPROF CPU sampling agent was removed from HotSpot JDKs in Java 9)

Similar to HPROF files, you can create PHD files by using the jcmd command line utility:

jcmd <PID> Dump.heap

The PID of the JVM can be found with the jps command line utility. Optionally, you can pass a third parameter for the path of the PHD file:

jcmd <PID> Dump.heap <path to phd file>

Most tools that can open HPROF files can also open PHD files, like JProfiler .

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