Version Differences for Dumps From a Java Process

(Added more spacing. Previous format looked like shit.)
(Re-alphabetizd.)
Line 3:
       
  <br/>    <br/> 
- = Windows =      
- This section lists methods to obtain fresh dumps on Windows-based platforms      
       
- <br/>      
- == All Java Versions ==      
       
- <br/>      
- === Thread Dump From Console Window ===      
       
- When a java process is running in a command prompt, you can simply press ['''CTRL''']+['''BREAK'''] to have the thread dump printed directly to the console. This text can then be extracted from the console and thrown in a text-editor for easier reading.      
       
- <br/>      
- === Thread Dump From a Windows Service ===      
       
- Due to the security designs of Windows Services on modern Windows versions, it is not as easy to get a thread dump. However, it is possible to get full permissions by setting up a scheduled task like such:      
       
- * '''at 17:34 cmd /c %JAVA_HOME%\bin\jstack.exe -l process-id# ^>C:\stack.txt 2^>^&1'''      
       
- Run this from an ''administrative command prompt''. You want to make the time 1 minute ahead of your current time and the ^ characters critical as they are the cmd.exe escape character. If you run it after the time has elapsed, it will run the next day instead, so be careful. You can run "at" without options to make sure your command is scheduled appropriately.      
       
- <br/>      
- == Java 6 ==      
- There may be different options for each type of Java installed. The commands listed below are known to work with the Java 6 JDK.      
       
- <br/>      
- === jstack (Thread Dump) ===      
- Using 'jstack', which is part of the JDK, you can run:      
       
- '''jstack -l process-id#'''      
       
- '''jstack -F -l process-id#''' (if the process is hung)      
       
- This command will then take a thread dump of the java process specified and dump it to the console. You may want to consider redirecting this output to a file with the ''>'' modifier.      
       
- <br/>      
- == 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.      
       
- <br/>      
- === jstack (Thread Dump) ===      
- Using 'jstack', which is part of the JDK, you can run:      
       
- '''jstack -l process-id#'''      
       
- '''jstack -F -l process-id#''' (if the process is hung)      
       
- This command will then take a thread dump of the java process specified and dump it to the console. You may want to consider redirecting this output to a file with the ''>'' modifier.      
       
- <br/>      
- === jmap (Heap Dump) ===      
- Using 'jmap', which is part of the JDK, you can run:      
       
- '''jmap -dump:format=b,file='''''filename'' '''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').      
       
       
- <br/>      
  = *nix =    = *nix = 
  This section lists methods to obtain dumps on *nix-based platforms    This section lists methods to obtain dumps on *nix-based platforms 
Line 145:
  This command will then take a thread dump of the java process specified and dump it to the console. You may want to consider redirecting this output to a file with the ''>'' modifier.    This command will then take a thread dump of the java process specified and dump it to the console. You may want to consider redirecting this output to a file with the ''>'' modifier. 
       
    + <br/>  
    + = Windows =  
    + This section lists methods to obtain fresh dumps on Windows-based platforms  
       
  <br/>    <br/> 
- = References =   + == All Java Versions ==  
       
    + <br/>  
    + === Thread Dump From Console Window ===  
       
    + When a java process is running in a command prompt, you can simply press ['''CTRL''']+['''BREAK'''] to have the thread dump printed directly to the console. This text can then be extracted from the console and thrown in a text-editor for easier reading.  
       
    + <br/>  
    + === Thread Dump From a Windows Service ===  
       
    + Due to the security designs of Windows Services on modern Windows versions, it is not as easy to get a thread dump. However, it is possible to get full permissions by setting up a scheduled task like such:  
       
    + * '''at 17:34 cmd /c %JAVA_HOME%\bin\jstack.exe -l process-id# ^>C:\stack.txt 2^>^&1'''  
       
    + Run this from an ''administrative command prompt''. You want to make the time 1 minute ahead of your current time and the ^ characters critical as they are the cmd.exe escape character. If you run it after the time has elapsed, it will run the next day instead, so be careful. You can run "at" without options to make sure your command is scheduled appropriately.  
       
    + <br/>  
    + == Java 6 ==  
    + There may be different options for each type of Java installed. The commands listed below are known to work with the Java 6 JDK.  
       
    + <br/>  
    + === jstack (Thread Dump) ===  
    + Using 'jstack', which is part of the JDK, you can run:  
       
    + '''jstack -l process-id#'''  
       
    + '''jstack -F -l process-id#''' (if the process is hung)  
       
    + This command will then take a thread dump of the java process specified and dump it to the console. You may want to consider redirecting this output to a file with the ''>'' modifier.  
       
    + <br/>  
    + == 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.  
       
    + <br/>  
    + === jstack (Thread Dump) ===  
    + Using 'jstack', which is part of the JDK, you can run:  
       
    + '''jstack -l process-id#'''  
       
    + '''jstack -F -l process-id#''' (if the process is hung)  
       
    + This command will then take a thread dump of the java process specified and dump it to the console. You may want to consider redirecting this output to a file with the ''>'' modifier.  
       
    + <br/>  
    + === jmap (Heap Dump) ===  
    + Using 'jmap', which is part of the JDK, you can run:  
       
    + '''jmap -dump:format=b,file='''''filename'' '''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').  
       
    + <br/>  
    + = Appendix A: References =  
       
  # 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]