What Java memory profiler applications will work on Windows 7 64-bit with Java 1.4 32-bit?

。_饼干妹妹 提交于 2020-01-06 04:50:08

问题


I'm trying to find a memory leak in an old Java 1.4 application. I have tried to use jmp but unfortunately I've had no luck getting it working (is it actually supported in Windows 7?).

If anyone knows of any free/open source Java 1.4 memory profilers that definitely work on Windows 7 64-bit, please let me know.


回答1:


I used JMP until we moved to Java 1.6.

http://www.khelekore.org/jmp/

GCViewer is nice if you're just verifying leaks:

http://www.tagtraum.com/gcviewer.html




回答2:


SAP has contributed a memory analyzer to eclipse which gives very nice and elaborate reports. check the below link

http://www.eclipse.org/mat/




回答3:


Did you already try

jps -l
jmap -histo <pid>

And then, I would install Java 6, run the same application, and use:

jconsole



回答4:


I have used YourKit Java profiler http://www.yourkit.com .




回答5:


I ended up doing the following:

  1. Add the -XX:HeapDumpPath=C:\Temp\HeapDump argument when starting the app
  2. Wait until it crashes with OutOfMemory exception
  3. Use Memory Analyzer (MAT) to see what was using so much memory.



回答6:


You're running on a 1.4 JVM, correct? It's not a 1.4-compiled class running on a 1.6 JVM? And is there a reason that you can't run the application on a 1.6 JVM, at least in a development environment?

If not, the built-in HProf agent should work, at least to find a memory leak. It will tell you what objects are live when you kill your program, and where they were allocated.

I'm not 100% certain, but I believe that you need to use the -Xrunhprof invocation option (the linked doc invokes with -agentlib, which I think may have been added in 1.5). Also, I think there was a version of 1.4 that supported the "modern" debug interface, so could be used with JConsole.



来源:https://stackoverflow.com/questions/3728713/what-java-memory-profiler-applications-will-work-on-windows-7-64-bit-with-java-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!