本文介绍了类似HPjmeter的图形工具,用于查看-agentlib:hprof profiling输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有哪些工具可用于查看内置JVM Profiler的输出?例如,我正在启动我的JVM:

What tools are available to view the output of the built-in JVM profiler? For example, I'm starting my JVM with:

-agentlib:hprof=cpu=times,thread=y,cutoff=0,format=a,file=someFile.hprof.txt

这会在hprof中生成输出( JAVA PROFILE 1.0.1)格式。

This generates output in the hprof ("JAVA PROFILE 1.0.1") format.

我过去使用以合理的方式查看这些输出文件。但是,无论出于何种原因,使用当前版本的Sun JVM生成的文件都无法加载到当前版本的HPjmeter中:

I have had success in the past using HPjmeter to view these output files in a reasonable way. However, for whatever reason the files that are generated using the current version of the Sun JVM fail to load in the current version of HPjmeter:

java.lang.NullPointerException
    at com.hp.jmeter.f.jb.a(Unknown Source)
    at com.hp.jmeter.f.a.a(Unknown Source)
    at com.hp.c.a.j.z.run(Unknown Source)
Exception in thread "HPeprofDataFileReaderThread" java.lang.AssertionError: null pointer exception from loader
    at com.hp.jmeter.f.a.a(Unknown Source)
    at com.hp.c.a.j.z.run(Unknown Source)

(为什么它们会混淆免费产品的字节码?!)

(Why would they obfuscate the bytecode for a free product?!)

由此产生两个问题:


  1. 有谁知道这个HPjmeter错误的原因? ( 编辑:是 - 请参阅下文

  2. 还有哪些其他工具可以读取hprof文件?为什么Sun没有(有)?

  1. Does anyone know the cause of this HPjmeter error? (EDIT: Yes--see below)
  2. What other tools exist to read hprof files? And why are there none from Sun (are there)?

我知道和其他工具可以动态监控JVMTI数据,但我需要一个可以处理生成的hprof文件的解决方案,因为部署的机器只有安装了JRE(不是JDK)。

I know the Eclipse TPTP and other tools can monitor JVMTI data on the fly, but I need a solution that can process the generated hprof files after the fact since the deployed machine only has a JRE (not a JDK) intalled.

编辑:一位非常有帮助的HPjmeter开发人员回复了我的,表明 heap = dump 需要暂时包含在 -agentlib 选项中,直到HPjmeter中的错误得到修复。这些信息使HPjmeter再次可行,但我仍然会问这个问题是否有人知道任何其他工具。

EDIT: A very helpful HPjmeter developer replied to my question on an HP ITRC forum indicating that heap=dump needs to be included in the -agentlib options temporarily until a bug in HPjmeter is fixed. This information makes HPjmeter viable again, but I will still leave the question open to see if anyone knows of any other tools.

EDIT :As版本4.0.00的HPjmeter(2009年5月可用)此错误已修复。

EDIT: As of version 4.0.00 of HPjmeter (available 05/2009) this bug has been fixed.

推荐答案

Java Profiler能够读取hprof快照(我不确定是仅用于内存分析还是用于CPU)。它不是免费的,但是迄今为止我用过的最好的java分析器。它以清晰,直观的方式呈现结果,并在大型数据集上表现良好。文档也很不错。

Your Kit Java Profiler is able to read hprof snapshots (I am not sure if only for memory profiling or for CPU as well). It is not free but is by far the best java profiler I ever used. It presents the results in a clear, intuitive way and performs well on large data sets. The documentation is also pretty good.

这篇关于类似HPjmeter的图形工具,用于查看-agentlib:hprof profiling输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-29 22:44