Try the new AI-powered WikiChat today at Special:AskQuestion.

Stack/Heap Dump

From MyWikis Testing
Jump to navigation Jump to search

Java Dump Tool

Setup

For this utility to work correctly, the JDK_HOME environment variable must point to the JDK from which Amoeba was launched (e.g. C:\Program Files\Java64\jdk1.8.0_74)

  1. Download the attached AmoebaDump.jar
  2. Right-click on My Computer
  3. Select Properties
  4. Go to the Advanced tab
  5. Click on the button Environment Variables
  6. Click the New button under System variables
  7. In the New System Variable box enter the following: Variable name= JDK_HOME Variable value= 'your full jdk path'
  8. Click OK to exit each dialog

Running It

  1. While running Amoeba on the machine, double click AmoebaDebug.jar to run it
  2. It will create a zip file containing the stack and heap for Amoeba, as well as anything else running on the same JRE. The location of the files is given in the text area of the utility window.
  3. The location of the stack, heap and zip files is given in the
  4. The zip file will be named MapAndStack-[Machine identifier]-[Timestamp].zip

Manually from Command Line

Finding Amoeba’s process id (pid)

  • Open a cmd window.
  • Navigate to the bin directory of the JDK running Amoeba (e.g. C:\Program Files\Java64\jdk1.8.0_74)
  • Execute jps
  • The results are process IDs of ALL Java applications running from that JDK, including jps. You may need to compare them with the Processes tab of TaskManager to figure out which one is Amoeba

Heap Dump

Execute jmap -dump:live,format=b,file= ‘fileName’ .hprof ‘pid’

StackTrace

Execute jstack -l ‘pid’ > ‘fileName’.txt

Windows 7 x64 .bat Scripts

  1. Make sure the windows7 pc has WinRAR installed. Either 32bit or 64 bit is fine. Just make sure you choose the default install directory
  2. Going forward, make sure system environment variable is JDK_HOME = C:\Java\jdk1.6.0_18 (this is x64 bit version of jdk)
  3. Because of ionic’s UAC security preference, you must run the Amoeba_Dump2.bat as administrator.
  4. The Amoeba_Dump2.bat and OZ_Dump2.bat runs the java JPS command to get Memory and Stack dump, then compresses with WinRAR, and finally FTPs to deb using lawrence’s credential.