3

Is there any way to view java hprof cpu profiling dumps which have been crated using the JRE builtin hprof agent's hprof=cpu=samples,format=b parameters?

The following tools do not support viewing hprof cpu sampling data:

  • VisualVM
  • YourKit
  • JProfiler
  • Eclipse MAT
MRalwasser
  • 15,605
  • 15
  • 101
  • 147
  • Visual VM ships with the JVM. I think you'll like the visual nature of it. – duffymo Jul 31 '17 at 10:13
  • @duffymo Visual VM does not show cpu sample information from a loaded (and externally created) hprof. It does only support/show hprof heap dump information. – MRalwasser Jul 31 '17 at 10:44

1 Answers1

1

Some Googling uncovers two tools that seem to analyze CPU profiling data generated by the hprof cpu=samples option (I haven't tried any of them):

  • PerfAnal: see this link and this one which seems from the project's page. However, it seems very old so hope you get lucky in using it.

  • A tool by HP called HPjmeter. The owner of this question mentions using it successfully for analyzing such profiling info. The user's manual of the tool says it supports binary format of the agent output.

Keep in mind that, in all cases, the hprof agent has always been experimental (this post discusses its inaccuracy) and that it will be even removed completely in Java 9. It's much better to use the tools you mentioned to analyze the application while running if possible.

M A
  • 71,713
  • 13
  • 134
  • 174
  • I'm aware of both. However, HPjmeter seems not to be free anymore (ok, this wasn't required by the question) and as you already mentioned, PerfAnal seems to be very old (and only with source code available). I was hoping that there's something new (and possibly free) at the market. But thanks anyway for pointing out hprof agent removal in java 9 which I wasn't aware of. BTW, I don't want to use hprof agent - I'm searching for a tool which can display hprof files created by my own tool. – MRalwasser Aug 04 '17 at 23:50
  • @MRalwasser If the binary format of your tool is aligned with the one generated by the JVM agent, the analyzers should be able to view them. It's interesting to know what the original developers of hprof intended to do with the binary format of CPU sampling. There doesn't seem to be a current JDK tool that generates an equivalent CPU sampling dump in the hprof format, so it kind of looks like that binary format was experimental and never official. BTW I've voted to re-open the question just in case a Sun/Oracle dev can miraculously answer this :) – M A Aug 05 '17 at 09:09