Jump to content

Emby server memory usage


parrish

Recommended Posts

revengineer

@@Happy2Play I believe it is exactly opposite.  All Windows Emby Server instances that I have seen?

This is the impression I have as well. While we have folks reporting that they have no leaks under windows, those who do report leaks seem to be all windows users. This would be a good time to tell me/us if I am wrong to avoid going down the wrong path.

 

I don't understand why you guys think anything under 1GB is a LEAK or excessive usage.

 

Anything between 0-800MB is normat depending on your library.  It has been that way from day one.  Or at least for me and 38TB of data it has.

 

 

 

 

 

 

Sorry looks like others are agreeing that they don't have or see a memory leak.

I would agree that if usage stays under 1 GB it is not a concern. I probably also would not have complained about the 1.4 GB I reported earlier today IF the memory usage was stable. But it is not. The absolute same server with the same configuration and same files that with emby in the same idle state was using 1.4 GB today was using 800 MB three days ago. Unfortunately I had to reboot today to fix crazy blinking cover images on the Roku emby client today, but given my 2+ years experience, I would bet money that I can get to 1.8 GB in a ten day period. Any takers?

Link to comment
Share on other sites

pir8radio

Can some of you guys with memory issues, possibly try out http://processhacker.sourceforge.net/  ?  Its called process hacker.    Its a more detailed task manager, that can tell you how much memory .net as well as exactly what emby is doing with the memory...  It might help the developers if something in particular is consuming a boat load of ram.     Once installed, right click the emby process go to properties then the memory tab. See if any of the line items that are not "Type: Reserved" and look abnormally high/large. Also check out the modules tab.   Might be worth a try.

Edited by pir8radio
Link to comment
Share on other sites

Untoten

So this morning when it hit 14gb after 12 hours again, I ended the service.  This showed, any ideas?
 59aac96b45307_pipeended.png

 

Also, since this has been happening, whenever I end the service, it shows ended in services.msc, but in the task manager it still shows emby and ffmpeg as running.  I then have to manually end each process before I can actually start the service again.  Maybe that gives more clues.

Link to comment
Share on other sites

Untoten

Something must have changed on your system then or you have some combination of hardware or plugins that non one else has.  Otherwise every single Emby user would have the same memory issue.

 

Have you tried installing the portable version?  Perhaps on different hardware?  Maybe you have a bad memory chip?

Nothing has changed, I believe I had said that previously, but I may be mistaken.  This server is purely for Emby, also, the memory is fine, I checked it.  I run 16gb ECC Ram in a Poweredge 2950.

Link to comment
Share on other sites

Causes of Error 109

  • Corrupt download or incomplete installation of Windows Operating System software.
  • Corrupt Windows registry keys associated with Windows Operating System.
  • Virus or malware infection that has corrupted Windows system files or Windows Operating System-related program files.
  • Another program maliciously or mistakenly deleted Windows Operating System-related files.
  • ERROR_BROKEN_PIPE.

Sounds like an OS issue, or you have malware or virus on your system.

 

 

So this morning when it hit 14gb after 12 hours again, I ended the service.  This showed, any ideas?
 59aac96b45307_pipeended.png

 

Also, since this has been happening, whenever I end the service, it shows ended in services.msc, but in the task manager it still shows emby and ffmpeg as running.  I then have to manually end each process before I can actually start the service again.  Maybe that gives more clues.

Edited by dcook
Link to comment
Share on other sites

Untoten

Causes of Error 109

  • Corrupt download or incomplete installation of Windows Operating System software.
  • Corrupt Windows registry keys associated with Windows Operating System.
  • Virus or malware infection that has corrupted Windows system files or Windows Operating System-related program files.
  • Another program maliciously or mistakenly deleted Windows Operating System-related files.
  • ERROR_BROKEN_PIPE.

Sounds like an OS issue, or you have malware or virus on your system.

Hmmm ok, I can do an OS reinstall, but it hasn't changed since this issue occured.  And Emby is literally the only software on it, so I doubt a virus.  But I will redo the whole system and report back.  Thanks for that, I should have googled it, adurr on my part.

Link to comment
Share on other sites

pir8radio

Hmmm ok, I can do an OS reinstall, but it hasn't changed since this issue occured.  And Emby is literally the only software on it, so I doubt a virus.  But I will redo the whole system and report back.  Thanks for that, I should have googled it, adurr on my part.

 

http://www.wiki-errors.com/err.php?wiki=109   they have a "tool" here may be worth a go before a full re-install.

 

I have not tested, so I don't know if its shady software.. You might want to look into it though.

 

Scratch that, It looks like that whole site is a lead-in to use their software.. It probably wont fix your issue.

Edited by pir8radio
Link to comment
Share on other sites

Like I said I haven't had much trouble with CPU utilization, memory usage, or memory leaks until I added live tv. I have the nightly Emby server restart plugin installed and working.

In order to get my system not to consume all memory resources in less than 24 I had to disable blast alive messages in DLNA.

 

 

616297d7f5f3674c3fb6d023126f5503.png

 

I found this solution earlier in this thread.

 

 

Sent from my iPhone using Tapatalk

Edited by Tur0k
Link to comment
Share on other sites

revengineer

Like I said I haven't had much trouble with CPU utilization, memory usage, or memory leaks until I added live tv. I have the nightly Emby server restart plugin installed and working.

In order to get my system not to consume all memory resources in less than 24 I had to disable blast alive messages in DLNA.

 

 

 

 

I found this solution earlier in this thread.

 

 

Sent from my iPhone using Tapatalk

I disabled DLNA but this does not prevent memory leaks. With nightly restarts, it is likely that you cannot tell whether you have a leak or not. Stop the nightly restart and report memory usage after about one week.

  • Like 1
Link to comment
Share on other sites

pir8radio

Has anyone tried the .net core server?

https://emby.media/community/index.php?/topic/50012-emby-server-for-net-core/

 

Although I'm starting to think this might be sqlite related, in which case it wouldn't matter. Nonetheless, I'd still be curious to know the results. Thanks.

I thought the latest stables (3.2.29+) were already dot net core ?

Link to comment
Share on other sites

I'm pretty sure we've ruled this out but this is happening to people running both as a service and as a normal app...right?

  • Like 1
Link to comment
Share on other sites

revengineer

Has anyone tried the .net core server?

https://emby.media/community/index.php?/topic/50012-emby-server-for-net-core/

 

Although I'm starting to think this might be sqlite related, in which case it wouldn't matter. Nonetheless, I'd still be curious to know the results. Thanks.

I do not use .net core. I need things reasonably stable for the family and I need the app as service.

 

I'm pretty sure we've ruled this out but this is happening to people running both as a service and as a normal app...right?

I am not sure we did. I use the service and I experience memory leak.

  • Like 1
Link to comment
Share on other sites

TylerV76

Ok I just set both my servers to run as a service both on windows 10 pro.

 

One having to transcode (outside of LAN and bandwith limitation set), my memory usage went to 3GB almost instantly even after I stop streaming. If I stop the service and run it as an app it sits at 145.1MB - 151.0MB

 

On the server locally that is direct playing, my memory usage is 108.7MB. On that same server, if I connect via my phone and transcode, I go to 159.0MB - 159.4MB. 

 

This is using the same apps to play media. So on one machine I can run it as a service and on the other I have to run it as an app. No rhyme or reason for the variance.

Link to comment
Share on other sites

Theodore

I'm pretty sure we've ruled this out but this is happening to people running both as a service and as a normal app...right?

 

I reported an issue like this several versions ago and it was resolved, but I've noticed it coming back recently too. When called to transcode or stream live TV is when I see the memory usage climb and is not released when finished.

Link to comment
Share on other sites

revengineer

I reported an issue like this several versions ago and it was resolved, but I've noticed it coming back recently too. When called to transcode or stream live TV is when I see the memory usage climb and is not released when finished.

I see memory growth with and without watching and/or recording Live TV; but it seems that growth is accelerated if Live TV is used for recording or watching.

Link to comment
Share on other sites

TylerV76

Had all kinds of issues with this today on my remote server. Lost a couple shows due to having to reboot the pc. Can't stream much of anything because the system is locking up. Right now it's at 3.5gb of memory used on a 4gb system. Going to have to add more ram tomorrow to that system. I've rebooted the pc and restarted emby at least 6 times in the past 3 hours.

 

Edit: it seems to happen when recording a show and having "automatically convert recording to streaming friendly format" is selected.

 

Sent from my SM-G950U1 using Tapatalk

Edited by TylerV76
Link to comment
Share on other sites

Additionally, some people are claiming 1GB+ is normal.  Some people claim 400-500MB is normal.  Can a developer provide feedback on this?  What is normal for an idling Emby Server?  @@Luke @@Sven

 

It al depends also on how big your collection is....

Edited by Sven
Link to comment
Share on other sites

tekman13

Hey I just installed by the other day and I'm seeing the memory leak issue. I've got a couple hundred gigs of media in the library and emby was at 800mb memory usage. As soon as I start live TV, it jumps to 2 GB and creeps up to 2.5 within about 5 minutes. It only stops there because memory utilization is 100% and I lose RDP capability and interactive login is incredibly slow as you would expect.

 

Let me know what I can provide to help get to the bottom of this.

 

Sent from my SAMSUNG-SM-N920A using Tapatalk

Link to comment
Share on other sites

TylerV76

Problem got worse tonight than ever before. I had 2 shows recording and the memory usage was so bad my remote PC is completely locked up. Cant RDP in, cant connect to the installation of Emby. Last I saw usage was at 3.2GB while transcoding the 2 recordings.Recording TV isnt an option anymore on this system. 

 

Edit: I finally got into the remote server and I installed the .8 beta. I turned off the option to "automatically convert recording to streaming friendly format". That seems to have fixed the memory issue and locking up the pc. Im currently recording 2 shows and memory is at 258MB. If I turn that option back on I spike to 3+GB. Whats interesting is if I turn this option off on the stable release .30 and view an active recording I can no longer fast forward on the active recording however on the beta I can. If I can maintain fast forwarding on an active recording without enabling "automatically convert recording to streaming friendly format" then that would be ideal. Im not sure if something was changed intentionally regarding that or not in the beta but it seems to be working. 

 

imo the memory issues are directly related to the "automatically convert recording to streaming friendly format" setting in live TV. 

Edited by TylerV76
Link to comment
Share on other sites

TheHwyman
Count me in on the issue at hand with the Emby memory utilization.
 
I first noticed this issue back in late June when my server went unresponsive (1st time I've had any issue with this server since I built it on Win2012r2 about 3 yrs ago). Investigated and discovered that the Emby service had consumed all available memory (Emby had grabbed ~15 GB). First time experiencing this issue and this server has been running the same overall configuration and running Emby for about 3 yrs since I first built the server.
 
I've experienced small Emby related issues over the years running it, usually after installing a new version. I therefore hold of installing newer Emby versions until things appear stable, like when 1-2 weeks goes by without successive .1 updates getting pushed out. I don't recall what the Emby version was that I had upgraded to in early June, but it was about 2 weeks after that when my server went unresponsive and this memory issue was apparent. After resetting the server, I checked it once or twice over the next couple of days and it didn't appear that the memory was "leaking" bad with the Emby service... so I chalked it up to an anomaly. Then a couple weeks later in July it happened again and the server went unresponsive.
Since I didn't have a lot of time to spend on this, I reset the server and then put together a script to stop/start the Emby service daily at 4:30am. It doesn't exhaust memory that fast (daily) and I was going to set it to do it weekly, but I am busy with work and travelling... I didn't want a situation where it dumped the server while I was away. so was playing it safe.
 
Since I set that up, obviously no more issues as in my case Emby never seems to exceed 2 GB of memory use within a 24hr period and the daily service stop/start was keeping things in check. Again, due to my work schedule and the issue not being front and center... I forgot about it and only remembered and had a bit of free time this past weekend that I revisited it. First by checking the forums to see if the issue had been reported and or a newer version of Emby released to address it. That's when I stumbled onto this thread.
 
So before opening my mouth, I wanted to gather some data... so I disabled my daily Emby service cycling script on Friday (Sept 1st) night and setup an ongoing Performance Monitor of a bunch of things from CPU, disk utilization as well as memory and set it up to take a sample every 30 sec and log it to a file every 24hrs (@ 4:30am). Here are the highlights:
 
2017-09-02:
  04:30 - 12:30 = ~350 MB
  12:30 - 15:30 = Growth (45* angle in the chart) from ~350MB to 1.9 GB
  15:30 - 16:00 = Decline from 1.9 GB to 1.5 GB
  16:00 - 04:30 = ~ 1.5 GB steady
 
2017-09-03:
  04:30 - 10:00 = up slightly to ~1.7 GB then steady
  10:00 - 11:20 = Growth (45* angle in the chart) from ~1.7 GB to 2.4 GB
  11:20 - 04:30 = ~2.4 GB steady
 
2017-09-04:
  04:30 - 17:20 = Slight growth from 2.4 GB to 2.6 GB
  17:20 - 18:30 = Growth (45* angle in the chart) from 2.6 GB to 3.4 GB
  18:30 - 04:30 = ~3.4 GB steady
 
Today's perflog won't get dumped until 4:30am tomorrow, but currently task manager is showing the Emby service as utilizing 4.3 GB as of 14:00 this afternoon. Appears to consume an increasing ~1 GB per 24hr period.
 
User Activity, according to Emby logs, during this timeframe:
 
2017-09-02:
  20:15 - 21:00 = 1 external user direct streamed 1 SD quality 43min show, no transcoding
    and delivered through the SSL port externally over the Internet
    to their Win7 based Intel NUC running Kodi 16 with Emby for Kodi 2.3.52
 
2017-09-04:
  23:00 - 00:00 = 1 external user direct streamed 1 SD quality 41min show, no transcoding
    and delivered through the SSL port externally over the Internet
    to their Win7 based Intel NUC running Kodi 16 with Emby for Kodi 2.3.52
 
New Media added to the library during this timeframe (Sat - Mon):
 - ~20 movies
 - ~140 tv episodes
 
So clearly, it's on a pace for ~2 weeks until it exhausts ~15 GB of memory on the server. The main observation being that nothing major is going on in Emby in the past couple days. That is, over the last 4 days... only 2 shows got direct streamed (no transcoding) and a bunch of media was added to the library... that's it. No LiveTV, no PVR stuff happens within Emby and DLNA is off. So I can't fathom why the regular daily increase in memory consumption with no subsequent release when whatever task(s) are complete. Even caching, after some period of time with no user connections or whatever... you'd think that would get released.
 
My setup:
=========
Clients to Emby:
- Intel NUC / Win7 / Kodi 16 with Emby for Kodi 2.3.52 (Internal network)
- Desktop PC / Win10 / Kodi 17 with Emby for Kodi 2.3.52 (Internal network)
- Intel NUC / Win7 / Kodi 16 with Emby for Kodi 2.3.52 (External Internet)
- MyGica Stick / Android / Kodi 17 with Emby for Kodi 2.3.52 (External network)
- Rasberry Pi / OpenElec / Kodi 17 with Emby for Kodi 2.3.49 (External network)

Server Configuration:
=====================
Windows Server 2012 R2
- 16 GB Memory
- 30 TB total disk space for media
Services Running on server:
- iSpy 6.4.2.0
- SABNZBd v2.2.0
- SickRage v2017.06.05-1
- NextPVR v4.0.4.170820
- Running Emby 3.2.26.0 (as a Windows Service) with Plugins:
  - Emby.Kodi Sync Queue 1.4.6362.2868
  - IPTV 1.0.6143.3907
  - Next PVR 3.0.6378.33055
  - LiveTV Config Identifies my (2) HD Homerun devices, but they are not utilized through Emby as they are utilized through NextPVR<->KODI separately from Emby. Although there does not appear to be a "Disable Tuner" setting that I can find to ensure that Emby is not trying to do anything with the tuners, so who knows. The Guide is set to retrieve 7 days worth of TV guide data every day. I was anticipating making the jump from NextPVR to Emby handling all of the LiveTV/PVR functions but hadn't gotten that far yet.
  - LiveTV setting "Automatically convert recordings to a streaming friendly format" is NOT enabled
  - DLNA is disabled
 
Media Library (9 Libraries defined):
  1) Movies (Movie Library) - Total # Movies: 3,528
  2) Documentaries & Sports (Movie Libary) - Total # of Movies: 71
  3) Standup Comedy (Movie Library) - Total # of Movies: 32
  4) Recorded Movies (Movie Library) - Total # of Movies: 0
  5) TV Shows (TV Library) - Total # of TV Shows: 626
      - Total # TV Show Episodes: 38,316
  6) Recorded Series (TV Library) - Total # of TV Shows: 3
                     - Total # TV Show Episodes: 282
  7) Music (Music Library) - Total # Music Artists: 740
      - Total # Music Albums: 2,420
      - Total # Music Songs: 23,505
  8) Music Concerts (Music Video Library) - Total # Music Concert Videos: 106
  9) Music Videos (Music Video Library) - Total # Music Videos: 914
 
Total of ~23 TB in media storage.
 
Now the other thought I had that I had not seen mentioned in the thread is what version of .NET do various people have installed (what is Emby's minimum .NET version req'd btw?) and what patches/updates have people installed?
It wouldn't be beyond the realm of possibilities that Microsoft has fubar'd something in a recent .NET release that is being magnified by Emby... I've seen that kind of thing before.
 
.NET Framework Updates Installed on my server:
==============================================
Dec 2016: (KB3205404) Security & Quality Rollup for .NET Framework 3.5, 4.5.2, 4.6, 4.6.1, 4.6.2
May 2017: (KB4019114) Security & Quality Rollup for .NET Framework 3.5, 4.5.2, 4.6, 4.6.1, 4.6.2
Aug 2017: (KB3186539) .NET Framework 4.7
 
According to my server logs, I updated the .NET with the May Rollup in early June. One of my breaks back home from work travel, I had updated the .NET, server patches and Emby on the same weekend. Then ~2 weeks later, this issue arose...
Btw, I am a server systems engineer/integrater by trade (worn all hats from h/w, storage, networking and programming over 30 yrs) and specialize as a troubleshooter for large backend integrated server systems, clusters, etc. So this kind of thing is what I do, problem being I don't have a lot of time to spend on really digging into this but wanted to post something to show that yes there are others experiencing this... (I wrote bits of this up in notepad over the past week to put it altogether in whatever free cycles I had so pardon me if the flow seems rough).
 
I'll continue to watch my perflog for the remainder of the week before I go out of town again and will be re-instating the Emby service cycling script before I leave.
Anyway just adding my $1 worth to the thread, I'll try to check-in here periodically as I can...
  • Like 1
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...