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.

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

    Code:
    jcmd [pid] GC.run
    Charlie
    Last edited by charlie; 08-21-2014 at 02:16 PM.

Similar Threads

  1. Unexpected exception.: java.lang.OutOfMemoryError: Java heap space
    By sriv.mayank in forum Performance and Tuning Discussion
    Replies: 1
    Last Post: 03-26-2014, 03:40 PM
  2. Replies: 9
    Last Post: 07-03-2013, 09: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, 07: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
  •