Jump to content

Out of memory


Akropolis
Go to solution Solved by fc7,

Recommended Posts

Akropolis

Since some time now I have problems playing video's with emby. Looks like emby uses all the memory it can get fast. I have a dedicated system for emby with 2G of RAM. Emby uses it all:

 

emby     25879  4.6 80.3 3958040 1514316 ?     Ssl  15:44   1:25 /usr/bin/mono-sgen --optimize=all /usr/lib/emby-server/....

 

80% memory use.

 

My current version (previous versions have the same issue):

emby-server-3.0.5724.6-349.1.noarch

 

Trying to play a video gives me:

2015-10-07 16:04:31.4726 Error - HttpServer: Error processing request for /videos/e6fc7608c572c30e7d175228a4b8acdc/stream.webm?DeviceId=842099d6030a4fdf951623fef13504888012f78c&MediaSourceId=e6fc7608c572c30e7d175228a4b8acdc&VideoCodec=vpx&AudioCodec=vorbis&AudioStreamIndex=1&VideoBitrate=872000&AudioBitrate=128000&MaxHeight=480&StartTimeTicks=13785161790&ClientTime=635798234702620610&PlaySessionId=<sessionid>&api_key=<apikey>&EnableAutoStreamCopy=false
        *** Error Report ***
        Version: 3.0.5724.6
        Command line: /usr/lib/emby-server/bin/MediaBrowser.Server.Mono.exe -programdata /var/lib/emby-server -ffmpeg /bin/ffmpeg -ffprobe /bin/ffprobe -restartpath /usr/lib/emby-server/restart.sh
        Operating system: Unix 3.10.0.229
        Processor count: 6
        64-Bit OS: True
        64-Bit Process: True
        Program data path: /var/lib/emby-server
        Mono: 4.0.3 (Stable 4.0.3.20/d6946b4 Thu Aug 13 12:39:47 UTC 2015)
        Application Path: /usr/lib/emby-server/bin/MediaBrowser.Server.Mono.exe
        ApplicationName='/bin/ffmpeg', CommandLine='-ss 00:22:58.516 -fflags +genpts -i file:"/media/tv/myvideo.mkv" -map 0:0 -map 0:1 -map -0:s -codec:v:0 libvpx -force_key_frames expr:gte(t,n_forced*5) -vf "scale=min(iw\,720):trunc(ow/dar/2)*2" -pix_fmt yuv420p -speed 16 -quality good -profile:v 0 -slices 8 -crf 10 -qmin 0 -qmax 50 -maxrate:v 872000 -bufsize:v (872000*2) -b:v 872000 -vsync vfr -map_metadata -1 -threads 5 -codec:a:0 libvorbis -ab 128000 -af "aresample=async=1" -y "/var/lib/emby-server/transcoding-temp/18f540c67c22cd04ef27d38b9ff85227.webm"', CurrentDirectory='', Native error= Out of memory
        ServiceStack.HttpError
        No Stack Trace Available

 

 

After I do a emby-server restart it works for a while. Any ideas?

Link to comment
Share on other sites

  • Solution

Which distribution are you using?

 

You may want to low down the nursery size for mono.

If you are running on CentOS or Fedora, you should be able to do this by editing /etc/emby-server.conf and giving it a lower size (64MB) instead of 512MB which is the default.

For example adding the following line:

MONO_ENV="MONO_THREADS_PER_CPU=500 MONO_GC_PARAMS=nursery-size=64m"

Please note that this will cause mono GC to run more frequently and it may have a negative impact on Emby performance.

Edited by fc7
  • Like 1
Link to comment
Share on other sites

Akropolis

Which distribution are you using?

 

You may want to low down the nursery size for mono.

If you are running on CentOS or Fedora, you should be able to do this by editing /etc/emby-server.conf and giving it a lower size (64MB) instead of 512MB which is the default.

For example adding the following line:

MONO_ENV="MONO_THREADS_PER_CPU=500 MONO_GC_PARAMS=nursery-size=64m"

Please note that this will cause mono GC to run more frequently and it may have a negative impact on Emby performance.

Thanks for your reply!

 

I am running CentOS 7.1. But what does nursery-size mean? I take it that 512M is the default, so by default 2GB of memory is not enough?

Link to comment
Share on other sites

Don't get my wrong but I don't think we should discuss about mono memory handling here, since it's an Emby forum. For more information on mono's nursery size and what it is you will find plenty of information in google.

 

Since you are running on CentOS 7 just try what I suggested before. Add the configuration value to /etc/emby-server.conf and restart emby-server service.

 

About system memory size, it really depends on how much you load it. I'm also running Emby on a dedicated VM with 2GB of RAM and I'm not having this problem but I must admit that my server only has 2 or 3 users and usually not even concurrent so the load is not really relevant. Others may have a dozen concurrent users with some of them doing transcoding at the same time so memory and CPU requirements will be much different.

Having said that if we detect that the default value is oversized, andcausing issues to many users we will review it and reduce it until we find a correct balance.

Link to comment
Share on other sites

  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...