为什么 jhat 的 -baseline 选项不起作用?
为什么每个对象似乎都被标记为新对象,而不仅仅是第二个快照中但不在我的基准快照中的对象? 在网上查看,我看到一些建议,我需要使用 hprof 而不是 jmap 来进行内存转储,但 hprof 似乎以完全相同的格式生成转储。
这是JDK 1.6.0_14; 我在 Windows 和 UNIX 上都试过了。
How come every object appears to be marked new, instead of just objects that are in the second snapshot but not in my baseline snapshot? Looking around online, I see some suggestions that I need to use hprof instead of jmap to make my memory dumps, but it appears that hprof generates dumps in exactly the same format.
This is JDK 1.6.0_14; I have tried on both Windows and UNIX.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
jhat -baseline
确实无法与jmap
生成的转储一起使用。 我不确定,但我相信这是因为 hprof 从一开始就附加到 JVM 并保留自己的对象跟踪,从而允许它在多个转储中生成一致的 ID。 不要引用我的话。 无论哪种方式,就您而言,重要的一点是 jmap 转储不起作用。然而,一切并没有失去。 去获取 Eclipse 内存分析器。 (如果您不使用 Eclipse,不用担心,您可以将其作为独立的可执行文件获取。)它比 jhat 更快,使用的内存比 jhat 更少并且它可以执行您想要的操作:
所有这些都可以通过 jmap 转储正常工作。
jhat -baseline
indeed won't work with dumps produced byjmap
. I'm not certain, but I believe this is because hprof attaches to the JVM right from the start and keeps its own track of objects, allowing it to produce consistent IDs across multiple dumps. Don't quote me on that. Either way, the important point as far as you're concerned is that jmap dumps don't work.However, all is not lost. Go and get the Eclipse Memory Analyzer. (If you don't use Eclipse, fear not, you can get it as a standalone executable.) It's faster than jhat, uses less memory than jhat and it can do what you want:
All of this works fine with a jmap dump.
看来你需要使用hprof。 但您确定使用同一个虚拟机实例吗?
如果一切都被认为是新的,我将确保这是同一虚拟机实例。
此处
It seems that you need to use hprof. But are you sure you use the same VM instance ?
If everything is considered as new, I will make sure that's the same instance of the VM.
Here