Jump to content

Question about RAM usage


masterxilef
 Share

Recommended Posts

masterxilef

Hello all,

I'am running emby-server on an old netbook I had laying arround with an atom N450 processor and Ubuntu Server 14.04 32bit, as I have no need for transcoding atm it is perfect for my needs right now. Been running it for a couple of months as a backend for Kodi and working great.

 

However, yesterday I upgraded the 1GB stick of RAM with a 2GB stick, the max the processor/mobo is capable.

So because I upgraded the RAM I had a question, would I benefit from upgrading to a 64bit os, seeing as the processor is capable of it, but I was running 32bit ubuntu because of the low RAM.

 

To find out, I decided to install a spare hard drive so I could install 32bit ubuntu, install emby-server, see cpu/ram consumption, then do the same with 64bit ubuntu and compare.

 

However, as I was doing that with 32bit ubuntu I encountered something peculiar that I don't know if it's normal.

 

I installed emby-server but haven't set up anything on the web ui just to see how the process acts with htop and discovered that after it starts it begins to consume more and more RAM till it's about 900MB, and then kinda restarts the process and begins doing it again.

 

Because of that, I haven't tested 64bit ubuntu.

 

So my question is, is that normal behavior for emby-server, maybe mono on linux, or maybe there's something wrong with my setup altought it's a fresh installation.

 

I attached what I think it's the latest log at this moment, and I think it's showing an error but I don't really know.

 

Thanks.

 

Edit: What would you recommend, use 64bit ubuntu or stick with the 32bit?

server-63593298069.txt

Edited by masterxilef
Link to comment
Share on other sites

With only 2GB of RAM going 64-bit will make no difference.

Just my two cents.

 

 

Sent from my iPhone using Tapatalk

Link to comment
Share on other sites

masterxilef

With only 2GB of RAM going 64-bit will make no difference.

Just my two cents.

 

 

Sent from my iPhone using Tapatalk

Thanks. That's what I was thinking.

 

Any thoughts on the RAM behavior?

Link to comment
Share on other sites

dcrdev

I've experienced similar behaviour with Emby under Fedora - although I believe that most of the memory consumption is cache.

 

I have 32GB of RAM in my server and within maybe an hour or two Emby ends up consuming 95% of it; I can flush the cache with "echo 3 > /proc/sys/vm/drop_caches", but Emby quickly swallows it again.

 

In practice this hasn't caused me any problems with other processes, which are free to allocate this "used" memory.

 

It's definitely not something I've encountered before - very strange.

Link to comment
Share on other sites

NomadCF

Debian 8 running Emby plus Mono are holding steady at high 6.2 Gigs (idle,  no users active, no scheduled jobs, no login attempts). I've tired removing all plugins, rebuilding Emby from scratch, etc. But nothing I do short of reducing the size of my libraries seems to have any impact. I might just need to set max allowed by mono.

Link to comment
Share on other sites

I'm not sure if this is the same problem, but I run emby through docker on unraid, and the other day I noticed that the RAM usage on my server was at about 90% (I have 8gb total), which is strange because I don't have that many things running

 

I tried turning some of my docker apps off to save some RAM, but nothing was really cutting the usage down until I stopped/restarted emby. I don't remember the exact numbers but RAM usage jumped from 90% to 60%. That's an awful lot of RAM. By that point my server had been up for a couple of weeks, but I still don't think it should be that high

 

So a few days ago I restarted emby and slowly over time RAM usage has been creeping up again. Today I restarted emby and RAM usage was back down

 

I wasn't sure if this was a docker only problem, but if other people are having problems on other OSes then maybe its a linux wide issue...

  • Like 1
Link to comment
Share on other sites

masterxilef

Based on my findings and your answers I beleive there's an issue with the Linux build (I think, not savy enought to declare for certain), because the RAM behavior I noticed with emby was even with no library or anything configured (later did this to rule it out, no change), however it's still usable, at least on my case, because even with the mere 2GB emby didn't seem to consume more than 1GB and restarted itself so the RAM consumption lowered, and didn't see any apparent disconnect from my Kodi clients.

 

Just for fun, I installed Windows 7 to compare perfomance and found emby using only about 200MB of RAM with everything already setup, and no apparent increase. Running on the same hardware. Granted, Windows use a lot more RAM tha ubuntu server in total, but emby RAM consumption seems stable.

Edited by masterxilef
Link to comment
Share on other sites

hurricanehrndz

I have run emby on my unraid instance for awhile and my system total ram usage is about 4gb, and I have 32gb of ram. Emby is using only 561MB of ram. I have no plugins whatsoever and my library is over 4500 individual media files.

 

unRAID version is 6.1.7.

 

Please everyone ensure there is no transcoding going on when you check ram usage. More then likely there will be some transcoding going on.

 

5JnpyXP.jpg

Edited by hurricanehrndz
Link to comment
Share on other sites

Karbowiak

Emby's using ~1.5GB memory here, and i have quite a lot of media added into it. Hell a library scan takes 15 minutes :\

Link to comment
Share on other sites

NomadCF

Just to make sure we're all on the same page, for those that are looking at or using "top" for memory usage we're talking about the "RES" column NOT the "VIRT". If your looking at the "VIRT" column and taking that mean memory used. Your misunderstanding the output of your tools. 

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
gsmitheidw

I'm having similar issues with emby on my system. I too am running an old netbook as a headless media server. It's an Asus 1005ha with a meagre 1gb ram and only an atom n280 processor @ 1.66ghz.

 

So I'm limited to 32bit operating system. I'm running Debian Jessie. I haven't gathered any evidence but my suspicions are memory leaking on 32bit implementations. I've deliberately left my library static for some time and at idle the physical ram climbs up to 85%.

 

Just to offer some balance I ran Universal Media Server and no such ram issues. And although its web frontend is very bare, it's Java based which can be a ram glutton it's still nothing near what im seeing with emby.

 

My main reason for wishing to use emby is it has a client for Roku which is handy for use on several TV and monitor systems I have without a native dlna or smart TV functions.

Edited by gsmitheidw
Link to comment
Share on other sites

gsmitheidw

Hope this is readable. As you can see this erver works hard enough anyway, lots going on - squid, bind, rutorrent etc. But nothing comes close to Embys ram consumption. This example not so bad as it hadn't been running that long

 

post-125403-0-68843900-1459634211_thumb.png

Edited by gsmitheidw
Link to comment
Share on other sites

  • 2 weeks later...
hurricanehrndz

Hope this is readable. As you can see this erver works hard enough anyway, lots going on - squid, bind, rutorrent etc. But nothing comes close to Embys ram consumption. This example not so bad as it hadn't been running that long

 

attachicon.gifScreenshot_2016-04-02-21-46-22.png

500mb of ram seems reasonable to me. There are things in the config file that you can do to lower memory consumption. 

Link to comment
Share on other sites

  • 2 months later...
arobinson

I have been seeing this issue with the Emby Docker under unraid 6.1.9 also.  I have 8GB of ram installed, with Emby turned off, my memory consumption is around 30% (according to the UI on the Emby dashboard)  after a few days with Emby running the ram usage climbs to about 90-95% and at that point it starts to kill running VM's.  I've been trying to figure out what seems to be the issue and according CADvisor there seems to be a garbage collection thread running in Emby that consumes all this extra ram.  I have also noticed that it appears that certain configuration directories seem to written to a ram drive, that in my case could also explain the approx 3.5GB of ram usage (mainly as my configuration directories including metadata amount to about 3.5 GB), though i have only been able to observe this issue under the Unraid plugin for Emby instead of the Docker image.

 

I'm not sure if this helps to shed more light on this subject or not, but it does seem incredibly odd that Emby would consume practically all the available ram on a system.  Is there a configuration setting perhaps that we are missing when we set it up?

 

Thanks

Edited by arobinson
Link to comment
Share on other sites

  • 8 months later...
inkubux

I also have the same issue, about once a week Mono/Emby in Docker will use all my RAM.. I have 4GB on my Unraid NAS server. Sometimes it will stop a stream halfway through because I don't have enough RAM. Restarting the Container resolves the issue for another week. Anybody found a solution ?

Link to comment
Share on other sites

mastrmind11

Create a cron job that restarts your server overnight every few days.

Link to comment
Share on other sites

kjp4756

I have experienced high memory usage with emby running on my ubuntu server.  After several days my server would slow to a crawl.  It turns out it was emby filling up the ram.  Server has 16GB RAM and all that runs on it is emby, samba and a 512MB pfsense virtual machine.

 

What I've done to fix the issue is add the following line to /etc/emby-server.conf

 

MONO_ENV=MONO_GC_PARAMS=max-heap-size=512M

 

I don't transcode anything so this works fine for me.  It may cause issues if you need to transcode.

Link to comment
Share on other sites

inkubux

I have experienced high memory usage with emby running on my ubuntu server.  After several days my server would slow to a crawl.  It turns out it was emby filling up the ram.  Server has 16GB RAM and all that runs on it is emby, samba and a 512MB pfsense virtual machine.

 

What I've done to fix the issue is add the following line to /etc/emby-server.conf

 

MONO_ENV=MONO_GC_PARAMS=max-heap-size=512M

 

I don't transcode anything so this works fine for me.  It may cause issues if you need to transcode.

 

Thanks I will try this.

Link to comment
Share on other sites

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
 Share

×
×
  • Create New...