Results 1 to 1 of 1

Thread: How to take a Java heap dump

  1. #1

    Default How to take a Java heap dump

    Take a heap dump using JConsole

    1. Use JConsole/JMX and connect to a running Wowza Media Server
    2. Select the MBeans tab
    3. Select the Operation section of the com.sun.management/HotSpotDiagnostics object
    4. Enter the following information into dumpHeap parameters and click dumpHeap button:
      Code:
      p0: [heap-output-path]
      p1: true - do a garbage collection before dump heap
      
      for example:
      p0: c:/dump.dmp
      p1: true


    Take a heap dump using the jhat command
    You can also take a heap dump using the jhat command that comes with the java JDK.

    1. Open a command prompt and change directory to the bin folder of the JDK installation
    2. Use operating system tools such as ps (ps -ef on Linux or the Task Manager on Windows) to find the process ID of the Java process that is running Wowza Server.
    3. Execute the command:
      Code:
      jmap -dump:format=b,file=c:\Temp\mymemorydump.hprof [pid]

    Where [pid] is the process id of the process running the Wowza Server.


    Take a heap dump automatically the next time an OutOfMemory error is thrown

    You can also configure Java to take a heap dump on OutOfMemory errors. To do this, edit [install-dir]/bin/setenv.sh (or [install-dir]/bin/setenv.bat or [install-dir]/bin/WowzaMediaServer-Service.conf on Windows) and add this to the JAVA_OPTS:

    Code:
    -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=[path-to-heapdump]
    Where [path-to-heapdump] is the path to where the heap dump file is stored (such as /opt).

    This is more info here:
    http://stackoverflow.com/questions/5...dump-for-jboss

    Once you have a heap dump file, post it somewhere for Wowza Support to download an analyze.

    Charlie
    Last edited by roger_l; 03-26-2014 at 02:31 PM. Reason: Add cmd line method

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •