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 object
    4. Enter the following information into dumpHeap parameters and click dumpHeap button:
      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:
      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/ (or [install-dir]/bin/setenv.bat or [install-dir]/bin/WowzaMediaServer-Service.conf on Windows) and add this to the JAVA_OPTS:

    -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).

    In Wowza Streaming Engine, edit conf/Tune.xml and uncomment the following line:
    <VMOption>-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="${com.wowza.wms.AppHome}/logs"</VMOption>
    This is more info here:

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

    To force a garbage collection before taking a heap dump run the following command:

    jcmd [pid]
    Last edited by roger_l; 09-14-2015 at 06:17 PM.

Similar Threads

  1. Unexpected exception.: java.lang.OutOfMemoryError: Java heap space
    By sriv.mayank in forum Performance and Tuning
    Replies: 1
    Last Post: 03-26-2014, 02:40 PM
  2. Replies: 9
    Last Post: 07-03-2013, 08:31 AM
  3. Wowza failed after 10 days - java.lang.OutOfMemoryError: Java heap space
    By tribalhost in forum Performance Tuning Discussion
    Replies: 5
    Last Post: 04-10-2013, 06:30 AM

Posting Permissions

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