Wowza Community

Unexpected exception.: java.lang.OutOfMemoryError: Java heap space

For the past few weeks, Wowza has been crashing with an OutofMemoryError every couple days, particularly over weekends.

This seems to have starting when we started using the Transcoder AddOn, but has persisted even though I’ve turned off everything except audio transrating for select streams.

There are probably about 15 streams running at a time, all of them being recorded, with users occasionally connecting to the streams as well.

Most of the time, heap usage isn’t too bad, but then it spikes for unknown reasons. This doesn’t match up with any memory, network, IO, or CPU profiles on the server it’s on, so it doesn’t appear to have to do with external programs. It also doesn’t seem to have much connection to the number of connections on the server, and the streams should be coming in at the same rate all the time.

Looking at the .hprof file generated, the main culprits were Cupertino and SanJose streamers. I turned off the Cupertino, but the San Jose streamer then just expanded in memory usage to produce the same effect.

I’ve gone through the Performance Tuning manual, but haven’t found anything to help yet in there. The heap is already set to the maximum 10G allowed.

Any clues as to what we could do? Thanks!

Hello there.

I think the best course for troubleshooting this would be to open a support ticket.

To do so please zip the following folders and send them to support@wowza.com:

[install-dir]/conf

[install-dir]/logs

[install-dir]/transcoder

[install-dir]/manager/logs

Also, for a full list of information the support team may ask for, please review this guide:

How to create a compressed zip file in Windows, OS X, and Linux

Regards,

Salvadore

Hi

From my experience it could be from udp packet loss from the encoder to wowza.

are the encoder and wowza in the same lan?

Hi,

This will now be handled in the created ticket (130120).

Jason

You have to specify the heap size whenever you run your program. If you are executing on the command line, whenever you execute using "java " include a parameter: “-Xmx4g -Xmx4g” or whatever you want your heap size to be. The flag Xmx specifies the maximum memory allocation pool for a Java Virtual Machine (JVM), while Xms specifies the initial memory allocation pool. The Xms flag has no default value, and Xmx typically has a default value of 256 MB. A common use for these flags is when you encounter a java.lang.OutOfMemoryError. If you are dealing with large data sets, then its always better to initialise your Java Collections (ex. Java Arraylist) with the correct size.