What Java memory profiler applications will work on Windows 7 64-bit with Java 1.4 32-bit?
I'm trying to find a memory leak in an old Java 1.4 application. I have tried to use jmp but unfort开发者_Python百科unately 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.
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
SAP has contributed a memory analyzer to eclipse which gives very nice and elaborate reports. check the below link
http://www.eclipse.org/mat/
Did you already try
jps -l
jmap -histo <pid>
And then, I would install Java 6, run the same application, and use:
jconsole
I have used YourKit Java profiler http://www.yourkit.com .
I ended up doing the following:
- Add the
-XX:HeapDumpPath=C:\Temp\HeapDump
argument when starting the app - Wait until it crashes with OutOfMemory exception
- Use Memory Analyzer (MAT) to see what was using so much memory.
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.
精彩评论