Memory leak
Posted: Thu Mar 27, 2014 2:11 am
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.
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.