Memory leak

For help and support with Universal Media Server
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply
Post Reply
galmok
Posts: 18
Joined: Wed Mar 26, 2014 10:31 pm

Memory leak

Post by galmok »

I just installed UMS and within 1 hour I had it shut down due to memory problems. The log file has this to say:

DEBUG 2014-03-26 14:40:45.403 [Thread-147] Cannot grow buffer size from 52,428,800 bytes to 209,715,200 bytes.
DEBUG 2014-03-26 14:40:45.403 [Thread-147] Error given: java.lang.OutOfMemoryError: Java heap space
DEBUG 2014-03-26 14:40:49.301 [Thread-147] Cannot grow buffer size from 52,428,800 bytes to 357,983,846 bytes either.
DEBUG 2014-03-26 14:40:49.301 [Thread-147] Error given: java.lang.OutOfMemoryError: Java heap space

There are several of such lines for this thread (147) and the first log entries for that thread was:

DEBUG 2014-03-26 14:40:37.338 [Thread-147] Waiting for pipe connection \\.\pipe\mencoder1395841237333
DEBUG 2014-03-26 14:40:37.338 [mencoder.exe-42] Starting "C:\Program Files (x86)\Universal Media Server\win32\mencoder.exe" -ss 0 "S:\someavi.avi" -msglevel statusline=2 -oac lavc -of mpeg -mpegopts format=mpeg2:muxrate=500000:vbuf_size=1194:abuf_size=64 -ovc lavc -channels 6 -lavdopts debug=0:threads=4 -lavcopts autoaspect=1:vcodec=mpeg2video:acodec=ac3:abitrate=640:threads=8:keyint=5:vqscale=1:vqmin=2:vqmax=3:vrc_maxrate=24000:vrc_buf_size=1835 -nosub -noautosub -ofps 24000/1001 -lavdopts fast -mc 0 -noskip -af lavcresample=48000 -srate 48000 -o \\.\pipe\mencoder1395841237333
DEBUG 2014-03-26 14:40:37.341 [mencoder.exe-42] Reading pipe: \\.\pipe\mencoder1395841237333
DEBUG 2014-03-26 14:40:37.341 [mencoder.exe-42] Attaching thread: mencoder.exe-42

but of course, the memory could have been used by something else.

I have UMS installed with defaults and the pc has 12GB memory.

My client couldn't process several of the playback attempts which I guess made UMS store the converted data in memory without blocking the converter. Maybe UMS shouldn't try to read all data into memory, but maybe just keep e.g. 20 MB? If this is an option, I can probably solve my problem using that, but I didn't notice it.
SpeedyQ
Posts: 173
Joined: Tue Jul 03, 2012 9:43 pm

Re: Memory leak

Post by SpeedyQ »

It might help if you post the full debug.log according to the support rules of the forum.
Also important to know what kind of operating system you run UMS on.
If you are using Windows, do you use the 64 bit version or the 32 bit version.
On 32 bit you can only address max 4Gb internal memory, which means that UMS can only use approx. 3Gb tops.

Also, have you tried different movie files? And different type of movie files? And does that give you the same issue result?
User avatar
DeFlanko
Posts: 724
Joined: Thu Jun 21, 2012 3:43 am
Location: San Pedro, CA
Contact:

Re: Memory leak

Post by DeFlanko »

I agree with SpeedyQ.
ExSport
Posts: 595
Joined: Wed Oct 10, 2012 1:57 am

Re: Memory leak

Post by ExSport »

When talking about JAVA, on 32bit you can't go higher than 1,5GB by default. UMS java application reserves 768MB heap memory by default. You can change it from Installation wizard or in registry (WIN):

Code: Select all

HKEY_CURRENT_USER\Software\Universal Media Server\HeapMem
If you will set value too high, UMS will not start at all. In this case you have to lower value until it will start.
When 64bit JAVA is used by UMS, you can go higher than 1,5GB but with 32bit, also in case of 12GB physical ram, it is almost impossible go higher than about 1,6GB if I remember well.
Try to search for "hello world" here in forum or in PS3MS forum for tips how to detect right value depending on the system.
User avatar
DeFlanko
Posts: 724
Joined: Thu Jun 21, 2012 3:43 am
Location: San Pedro, CA
Contact:

Re: Memory leak

Post by DeFlanko »

ExSport -- you should help me update the Wiki =)
User avatar
Optimus_prime
Posts: 678
Joined: Fri Jun 01, 2012 6:39 pm
Location: Sydney, Australia

Re: Memory leak

Post by Optimus_prime »

Agreed DeFlanko, we do need to put a little info about the Java Heap stuff as it's a common theme/question and something people get incorrect (even me!!!!)
How Ask For Support
Remember, Debug Log's Can/Will Help and Explain your issues, we're not mind reader's but here to help
OS's I Use And Can Assist With: Windows 7/8, Mac OS-X 10.8 & 10.9
Mac OS-X Java 7 Builds Mac OS-X Java 7 Forum
ExSport
Posts: 595
Joined: Wed Oct 10, 2012 1:57 am

Re: Memory leak

Post by ExSport »

I should find my old post about this topic where I described how people can test their optimal heap size and why we need bigger sizes for specific cases as e.g. more renderers playing files simultaneously etc... :-)
Post Reply