Jump to content

Emby server memory usage


parrish

Recommended Posts

Jdiesel

After 24 hours running the .Net Core version of Emby Server on Ubuntu I am at 3.4GB of memory used with no clients or playback currently active. I will resist the urge to update today and post an update tomorrow.

emby-server.service - Emby Server is a personal media server with apps on just about e
   Loaded: loaded (/usr/lib/systemd/system/emby-server.service; enabled; vendor preset:
   Active: active (running) since Tue 2017-10-03 08:26:37 CST; 1 day 5h ago
 Main PID: 20461 (dotnet)
    Tasks: 450
   Memory: 3.4G
      CPU: 1d 7min 26.890s

Link to comment
Share on other sites

revengineer

After three days on v3.2.33, I am already up to 1 GB of memory use. Two nights ago something interesting happened:  I lost my internet connection and as a result, there were lots of errors in the log file presumably from failed attempts reaching the internet, most notable updates to subtitles via Open Subtitles. That night emby memory usage increased by 500 MB over a less than 12 hour period WITHOUT any active viewing. This supports my suspicions that my leak is caused by emby background activities, which makes this really hard to track down. 

 

I think the only way to track this down is for the developers to add debug code to track memory use for the individual tasks. Anecdotes like mine above or posted by others in this forum are interesting but not really helpful for resolving the matter. It may be worth investing here as, if I remember correctly, there was already at least one user who reported a memory leak with the .core version. 

Link to comment
Share on other sites

Jdiesel

 

After 24 hours running the .Net Core version of Emby Server on Ubuntu I am at 3.4GB of memory used with no clients or playback currently active. I will resist the urge to update today and post an update tomorrow.

emby-server.service - Emby Server is a personal media server with apps on just about e
   Loaded: loaded (/usr/lib/systemd/system/emby-server.service; enabled; vendor preset:
   Active: active (running) since Tue 2017-10-03 08:26:37 CST; 1 day 5h ago
 Main PID: 20461 (dotnet)
    Tasks: 450
   Memory: 3.4G
      CPU: 1d 7min 26.890s

 

Today the service is reporting 12.9GB of ram used.

emby-server.service - Emby Server is a personal media server with apps on just
   Loaded: loaded (/usr/lib/systemd/system/emby-server.service; enabled; vendor
   Active: active (running) since Tue 2017-10-03 08:26:37 CST; 1 day 23h ago
 Main PID: 20461 (dotnet)
    Tasks: 507
   Memory: 12.9G
      CPU: 1d 19h 2min 34.267s

When I view the process in top I get
 
PID     USER      PR  NI    VIRT      RES       SHR S     %CPU %MEM  TIME+       COMMAND
20461   emby      20   0    10.672g  3.381g    32096 S    1.0  21.6  418:01.08   dotnet

The strange part is that the virtual memory is now high and if I understand correctly isn't an indicator of actual memory usage.

Edited by Jdiesel
Link to comment
Share on other sites

BloodyIron

In my scenario I don't allow writes to the folders that has media, so it's organised in a storage regard. Meta stuff is stored elsewhere, which works. However I had it previously set to get subtitles for movies, which currently seem to "require" write access to the media folders. I put in a feature request for this scenario, as it just throws an error for each movie that it can't write subtitles for, every time. Yesterday I turned getting subtitles for Movies off though. So this may be adversely contributing to the memory situation, but I am not sure.

Link to comment
Share on other sites

Dizzy49

Running Emby Server on Windows 10 Pro

 

Just rebooted, Idle with No connections it's using 250mb

Connected one user (via Emby Theater on a PC) and only browsing, and it jumped to 550mb

Disconnected and memory stayed at 548mb

Playing a 1080p video (Direct Play) added less than 5mb

Playing a 4K video (Direct Play), it jumped to 670mb, but after about 5 seconds it went back to 670mb and holding steady

Disconnected from Emby Theater.

Connected via Fire Stick, only browsing, memory is at 645mb

Playing 1080p video (Direct Play) went to 670mb

Added second login (via Android app), jumped 100mb for about 5 seconds, then back down to 670mb (still streaming the 1080p video).

LOL, Direct Playing 1080p to my phone as well actually lowered it to 630mb!

Direct Play of 4K to my phone lowered it to 610mb (though there is actually no video displaying on my phone)

Set phone to 1080p 5MB to force transcode of 4K video, still only 630mb (CPU is at 99%)

Ran my scheduled tasks (Chapter Image Extraction running now), it only added about 10mb to memory usage.

 

 

Odd note, my Malwarebyte Service and Endpoint Agent are using 1,051mb and 690mb currently.

Link to comment
Share on other sites

Kipperdawn

Unfortunately, I too am being affected by the memory bug... pre mid summer, my emby server would sit around 300 MB usage, but now it slowly crawls up... me opening up browsers or apps makes it climb faster, but even if i disconnect everything, close all browsers, it slowly crawls up. Literally, if i just sit and watch it in task manager, it just keeps allocated memory in a following pattern - allocate several MB, return a bit, allocate more, return a little bit, etc.... If left long enough, all my memory is consumed. For example, under light usage over the last couple days from a restart, i am almost at a 1 GB of memory (and climbing).

 

I am running the latest version - 3.2.33.0

My configuration is windows server 2012r2 with latest ms patches. I have 32 GB of ram. My library is reasonably small at ~6 TB. I have NO plugins installed. I do NOT have live TV... this is basic install geared towards playback only. There is nothing else running directly on the server from an app POV, but i do run hyper-v which hosts my other VMs.  I use the portable version and emby run's as a service. I will try out the other version Luke suggest to see if it makes any difference for me. 

 

If there is specific info you require that I didn't provide, let me know and I will try to get it.

 

thx

kp

 

Link to comment
Share on other sites

RedBaron164

So I've noticed that with my install, memory usage will climb, and then appears to hit a wall when the system hits about 80-85% memory utilization. At which point Emby's memory usage stops growing. Since I rebooted last week, Emby's memory usage grew to about 1.6gb and is bouncing between 1.3gb and 2gb depending on what I'm doing. The behavior somewhat reminds me of Microsoft SQL or Exchange which likes to use as much memory as possible and will just take all the memory it can. Which if that is what Emby is gonna do I'm fine with it provided that it can release memory back to other applications that may need it.

 

But this leaves me wondering, is Emby behaving like this for other people in this thread or is it running their systems straight to 100% memory utilization?

  • Like 1
Link to comment
Share on other sites

TheKamakaZi

So I've noticed that with my install, memory usage will climb, and then appears to hit a wall when the system hits about 80-85% memory utilization. At which point Emby's memory usage stops growing. Since I rebooted last week, Emby's memory usage grew to about 1.6gb and is bouncing between 1.3gb and 2gb depending on what I'm doing. The behavior somewhat reminds me of Microsoft SQL or Exchange which likes to use as much memory as possible and will just take all the memory it can. Which if that is what Emby is gonna do I'm fine with it provided that it can release memory back to other applications that may need it.

 

But this leaves me wondering, is Emby behaving like this for other people in this thread or is it running their systems straight to 100% memory utilization?

Funny enough, I tested your theory 2 weeks ago by limiting the memory allocated to my emby docker instance to 2GB, which seems to have curbed its appetite. Haven't experienced any OOMs since.

 

Sent from my SM-G935F using Tapatalk

  • Like 1
Link to comment
Share on other sites

RedBaron164

I'm running Emby on a VM and I only gave the VM 4GB of ram. The total system memory usage on the VM has been hovering at around 80%. Emby hasn't ran the system out of memory recently. The last time Emby ran the system out of memory and actually crashed for me was last month and I think it was running 3.2.31 at the time.

  • Like 1
Link to comment
Share on other sites

jhoff80

Server 2016 here, .Net Stable install, seeing currently 6GB of RAM usage (though I have 32GB total so it hasn't been too huge a concern).  When I freshly start the service, it's usually at 150MB or so, and continues to grow over time.

 

Not sure if it's related to this, but I observed both things starting at around the same time.  Sometime over the summer, shutdown of Emby Server also slowed drastically for me, to the point I tell the service to stop, then have to open Task Manager and observe/wait 5-10 minutes before I can actually run the updater.  I've been assuming it's related to the higher RAM usage somehow.

Link to comment
Share on other sites

BloodyIron

I'm on 3.2.33.0, and about 2.83GB of RAM is being used, and it still seems to be trending upward for RAM usage growth. It's looking still similar to the 100-200MB/day, but it hasn't pushed into swap just yet.

Link to comment
Share on other sites

Happy2Play

Hmm why does this only happen to people with a lot of RAM?  I have 4GB of Ram and rarely exceed 1GB used by Emby and when it does it gets release eventually and idles around 400-500MB.

Link to comment
Share on other sites

CBers

Hmm why does this only happen to people with a lot of RAM? I have 4GB of Ram and rarely exceed 1GB used by Emby and when it does it gets release eventually and idles around 400-500MB.

My server I've been monitoring and reporting here, has 24Gb ram but still only using ~164MB.

  • Like 1
Link to comment
Share on other sites

PenkethBoy

i have both stable and beta on my (32gb) 2012r2 Essentials server and they are both at about 250MB - they go up a bit when doing a scan or watching something - transcode or not and come back down within say 30-60 mins

 

the stable server (33.0) has been up for over a week now without any issue from a memory point of view.

  • Like 2
Link to comment
Share on other sites

Is anyone who has had memory issues in the past running a SONOS system? I have pinpointed several huge increases in RAM usage that was not reclaimed. At that point the log file gets busy with what appears to be attempted DLNA access or probing to or from a SONOS system. This is repeated consistently and for hours in the log file. 192.168.2.23 is a sonos play bar. Not sure if it is related or not. I also have no profile for a SONOS system recorded on the server.

 

edit: Running version 3.2.33.0

 

 

2017-10-12 15:15:38.134 Info HttpClient: HttpClientManager POST: http://192.168.2.23:1400/MediaRenderer/AVTransport/Control
2017-10-12 15:15:38.134 Info HttpClient: HttpClientManager POST: http://192.168.2.23:1400/MediaRenderer/AVTransport/Control
2017-10-12 15:15:38.134 Info HttpClient: HttpClientManager POST: http://192.168.2.23:1400/MediaRenderer/AVTransport/Control
2017-10-12 15:15:38.134 Info HttpClient: HttpClientManager POST: http://192.168.2.23:1400/MediaRenderer/AVTransport/Control
2017-10-12 15:15:38.134 Info HttpClient: HttpClientManager POST: http://192.168.2.23:1400/MediaRenderer/AVTransport/Control
2017-10-12 15:15:38.134 Info HttpClient: HttpClientManager POST: http://192.168.2.23:1400/MediaRenderer/AVTransport/Control
2017-10-12 15:15:38.134 Error Dlna: Error reporting progress
    *** Error Report ***
    Version: 3.2.33.0
    Command line: C:\Users\tonos\AppData\Roaming\Emby-Server\system\MediaBrowser.ServerApplication.exe -service
    Operating system: Microsoft Windows NT 6.2.9200.0
    64-Bit OS: True
    64-Bit Process: True
    User Interactive: False
    Processor count: 4
    Program data path: C:\Users\tonos\AppData\Roaming\Emby-Server
    Application directory: C:\Users\tonos\AppData\Roaming\Emby-Server\system
    System.NullReferenceException: Object reference not set to an instance of an object.
     at Emby.Dlna.PlayTo.PlayToController.StreamParams.GetItemId(String url)
     at Emby.Dlna.PlayTo.PlayToController.StreamParams.<ParseFromUrl>d__45.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
     at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
     at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
     at Emby.Dlna.PlayTo.PlayToController.<_device_PlaybackProgress>d__30.MoveNext()
    System.NullReferenceException
     at Emby.Dlna.PlayTo.PlayToController.StreamParams.GetItemId(String url)
     at Emby.Dlna.PlayTo.PlayToController.StreamParams.<ParseFromUrl>d__45.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
     at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
     at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
     at Emby.Dlna.PlayTo.PlayToController.<_device_PlaybackProgress>d__30.MoveNext()

Edited by Tonos
Link to comment
Share on other sites

CBers

Is anyone who has had memory issues in the past running a SONOS system? I have pinpointed several huge increases in RAM usage that was not reclaimed. At that point the log file gets busy with what appears to be attempted DLNA access or probing to or from a SONOS system. This is repeated consistently and for hours in the log file. 192.168.2.23 is a sonos play bar. Not sure if it is related or not. I also have no profile for a SONOS system recorded on the server.

 

I have 3 Sonos devices, including the PlayBar, but I don't have DLNA enabled on my server.

 

My memory usage is still floating around the 164MB mark.

Link to comment
Share on other sites

mastrmind11

I have 6 sonos devices, DLNA disabled, no memory issues.

 

Is it possible that those experiencing the memory issue all have DLNA enabled?

Link to comment
Share on other sites

jhoff80

I don't have DLNA enabled.  I restarted the server shortly after my post here on 11Oct, and now am currently at 3.4GB of RAM use.

Link to comment
Share on other sites

Happy2Play

I can assume all reports of issues are from a idle server not doing anything.

Link to comment
Share on other sites

Chillout

5-days uptime and the memory usage is getting excessive...  havent seen any server updates lately so this is probably the longest its run in a long time. 

 

OS: WIn7 x64

Version 3.2.33.0

 

59e16bd12b468_Untitled.png

Edited by Chillout
Link to comment
Share on other sites

BloodyIron

I wonder how some Windows users are using so little RAM, how curious. What database type do Windows users, use, in this scenario?

Link to comment
Share on other sites

pir8radio

Have any of you tried the .net core beta version?   I doubt they are going to fix this issue in the current stable version since the .net is going to be the future path of emby. I mean that's just my personal assumption.     

 

Here is a graph of my server pre/post install of  the .net core beta.   I upgraded on 10/7/2017    you can see previously my server consumed over 4 gigs of ram,  You can see after the .net core install it barely gets above 500mb  it does slowly ramp up over 7 days by a few mb, but then it drops off and starts over.   Only time will tell, but this is a major improvement over the second graph, you can see how it climbs and climbs in Gigabytes vs a few Megabytes over the same time frame. 

 

.net core beta Version:

59e3669e9c315_upgraded.png

 

Stable Version:

59e367e992aa8_memory.png

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
×
×
  • Create New...