|
(→Thread Dump From Console)
|
(Reordered least to most)
|
| Line 12: | |||
| This section lists methods to obtain dumps on *nix-based platforms | This section lists methods to obtain dumps on *nix-based platforms | ||
| - | == Java 7 == | + | == Java 5 == |
| There may be different options for each type of Java installed. The commands listed below are known to work with the Java 7 JDK. | There may be different options for each type of Java installed. The commands listed below are known to work with the Java 7 JDK. | ||
| Line 18: | |||
| - | Using 'jmap', which is part of the JDK, you can run: | + | Using 'jmap', which is part of the JDK, you can run one of the following commands: |
| - | '''jmap -dump:format=b,file='''''filename'' '''process-id#''' | + | '''jmap process-id#''' |
| - | This command will then dump the memory map of the target process-id# to an hprof file within the current directory (or specified directory if you expand on 'filename'). | + | '''jmap -heap process-id#''' |
| + | '''jmap -histo process-id#''' | ||
| + | This command will then dump a summary of the current memory map to the console. While not as sophisticated as the later versions of java, it still provides some rudimentary functionality. | ||
| == Java 6 == | == Java 6 == | ||
| There may be different options for each type of Java installed. The commands listed below are known to work with the Java 7 JDK. | There may be different options for each type of Java installed. The commands listed below are known to work with the Java 7 JDK. | ||
| Line 32: | |||
| This command will then dump the memory map of the target process-id# to an hprof file within the current directory (or specified directory if you expand on 'filename'). | This command will then dump the memory map of the target process-id# to an hprof file within the current directory (or specified directory if you expand on 'filename'). | ||
| - | == Java 5 == | + | == Java 7 == |
| There may be different options for each type of Java installed. The commands listed below are known to work with the Java 7 JDK. | There may be different options for each type of Java installed. The commands listed below are known to work with the Java 7 JDK. | ||
| Line 38: | |||
| - | Using 'jmap', which is part of the JDK, you can run one of the following commands: | + | Using 'jmap', which is part of the JDK, you can run: |
| - | '''jmap process-id#''' | + | '''jmap -dump:format=b,file='''''filename'' '''process-id#''' |
| - | '''jmap -heap process-id#''' | + | This command will then dump the memory map of the target process-id# to an hprof file within the current directory (or specified directory if you expand on 'filename'). |
| - | '''jmap -histo process-id#''' | ||
| - | This command will then dump a summary of the current memory map to the console. While not as sophisticated as the later versions of java, it still provides some basic functionality. | ||
| = References = | = References = | ||
| - | # Java 7 'jmap' info: [http://docs.oracle.com/javase/7/docs/technotes/tools/share/jmap.html jmap - Memory Map] | ||
| - | # Java 6 'jmap' info: [http://docs.oracle.com/javase/6/docs/technotes/tools/share/jmap.html jmap - Memory Map] | ||
| # Java 5 'jmap' info: [http://docs.oracle.com/javase/1.5.0/docs/tooldocs/share/jmap.html jmap - Memory Map] | # Java 5 'jmap' info: [http://docs.oracle.com/javase/1.5.0/docs/tooldocs/share/jmap.html jmap - Memory Map] | ||
| + | # Java 6 'jmap' info: [http://docs.oracle.com/javase/6/docs/technotes/tools/share/jmap.html jmap - Memory Map] | ||
| + | # Java 7 'jmap' info: [http://docs.oracle.com/javase/7/docs/technotes/tools/share/jmap.html jmap - Memory Map] | ||