- Examine the fatal error log file. Default file name is hs_err_pidpid.log in the working-directory.
- Create a heap dump:
- Start the application with HPROF enabled: java -agentlib:hprof=file=file,format=bapplication; then Control-\
- Start the application with HPROF enabled: java -agentlib:hprof=heap=dump application
- JConsole tool, MBeans tab
- Start VM with -XX:+HeapDumpOnOutOfMemoryError; if OutOfMemoryError is thrown, VM generates a heap dump.
- Browse Java heap dump:
- jhat heap-dump-file
- Dump Java heap from core file in binary format to a file:
- jmap -dump:format=b,file=filename corefile
- Get a heap histogram for a process:
- Start Java process with -XX:+PrintClassHistogram, then Control-\
- jmap -histo pid (with -F option if pid does not respond)
- Get a heap histogram from a core file:
- jmap -histo corefile
- Print shared object mappings from a core file:
- jmap corefile
- Print heap summary from a core file:
- jmap -heap corefile
- Print finalization information from a core file:
- jmap -finalizerinfo corefile
- Print Java configuration information from a core file:
- jinfo corefile
- Print thread trace from a core file:
- jstack corefile
- Print lock information from a core file:
- jstack -l corefile
- Attach the command-line debugger to a core file on the same machine:
- jdb -connect sun.jvm.hotspot.jdi.SACoreAttachingConnector:javaExecutable=path,core=corefile
- Attach the command-line debugger to a core file on a different machine:
- On the machine with the core file: jsadebugd path corefile
and on the machine with the debugger: jdb -connect sun.jvm.hotspot.jdi.SADebugServerAttachingConnector:debugServerName=machine
- On the machine with the core file: jsadebugd path corefile
- libumem can be used to debug memory leaks.
It has Articles,News,Awareness Features,Business Updates,Entertainment,Pictures,Latest,Controversial Issues,Films Review,Sports,Wallpapers And Much More...
Thursday, September 29, 2011
Post-mortem Diagnostics, Memory Leaks
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment