Take a heap dump using JConsole
- Use JConsole/JMX and connect to a running Wowza Media Server
- Select the MBeans tab
- Select the Operation section of the com.sun.management/HotSpotDiagnostics object
- Enter the following information into dumpHeap parameters and click dumpHeap button:
p1: true - do a garbage collection before dump heap
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.
- Open a command prompt and change directory to the bin folder of the JDK installation
- 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.
- 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/setenv.sh (or [install-dir]/bin/setenv.bat or [install-dir]/bin/WowzaMediaServer-Service.conf on Windows) and add this to the JAVA_OPTS:
Where [path-to-heapdump] is the path to where the heap dump file is stored (such as /opt).
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: