Jump to content

Heavy RAM usage (41GB) related to Open Subtitles?


solidsnakex37

Recommended Posts

solidsnakex37

I noticed this morning that Emby was using 41GB of RAM which is not common. I checked the logs and the only errors I could find were the following, also attached the server log from when this occurred. 

In unraid I checked what process was consuming all that memory and it was this, which matched the error in the emby server log
image.thumb.png.ff0de74e943fe4a8469e295f0b084bf8.png

2023-11-01 00:05:09.847 Error SubtitleManager: Error downloading subtitles from Open Subtitles
	*** Error Report ***
	Version: 4.7.14.0
	Command line: /system/EmbyServer.dll -programdata /config -ffdetect /bin/ffdetect -ffmpeg /bin/ffmpeg -ffprobe /bin/ffprobe -restartexitcode 3
	Operating system: Linux version 6.1.49-Unraid (root@Develop-612) (gcc (GCC) 12.2.0, GNU ld version 2.40-slack151) #1 SMP PREEMPT_DYNAMIC Wed Aug 30 09:42:35 PDT 2023
	Framework: .NET 6.0.20
	OS/Process: x64/x64
	Runtime: system/System.Private.CoreLib.dll
	Processor count: 32
	Data path: /config
	Application path: /system
	System.Exception: System.Exception: Exception of type 'System.Exception' was thrown.
	   at OpenSubtitles.OpenSubtitleDownloader.ValidateResponseXml(String xml)
	   at OpenSubtitles.OpenSubtitleDownloader.Login(CancellationToken cancellationToken)
	   at OpenSubtitles.OpenSubtitleDownloader.Search(SubtitleSearchRequest request, CancellationToken cancellationToken)
	   at Emby.Providers.Subtitles.SubtitleManager.SearchSubtitles(SubtitleSearchRequest request, CancellationToken cancellationToken)
	Source: OpenSubtitles
	TargetSite: Void ValidateResponseXml(System.String)


Not sure what the above error indicates? I checked that I wasn't banned on open subs using https://www.opensubtitles.org/addons/show_my_ip.php

Also using the link above, it says I haven't downloaded any subs at all  in the last 24 hours, so I am more confused on what caused the memory usage to climb, unless it's a memory leak? 

image.png.97bb816bccd445237af45905fac22bd0.png

 

Edited by solidsnakex37
Logs aren't anonymized
Link to comment
Share on other sites

solidsnakex37

I posted the logs but removed them, noticed that even though I have the Anonymize Log Contents enabled, it still showed my hostname to my server which I won't want to advertise 

Link to comment
Share on other sites

solidsnakex37
2023-11-01 00:07:17.110 Error SubtitleManager: Error downloading subtitles from Open Subtitles
	*** Error Report ***
	Version: 4.7.14.0
	Command line: /system/EmbyServer.dll -programdata /config -ffdetect /bin/ffdetect -ffmpeg /bin/ffmpeg -ffprobe /bin/ffprobe -restartexitcode 3
	Operating system: Linux version 6.1.49-Unraid (root@Develop-612) (gcc (GCC) 12.2.0, GNU ld version 2.40-slack151) #1 SMP PREEMPT_DYNAMIC Wed Aug 30 09:42:35 PDT 2023
	Framework: .NET 6.0.20
	OS/Process: x64/x64
	Runtime: system/System.Private.CoreLib.dll
	Processor count: 32
	Data path: /config
	Application path: /system
	System.Xml.XmlException: System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.
	   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
	   at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
	   at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
	   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
	   at OpenSubtitles.OpenSubtitleDownloader.ParseXmlResponse(String xml)
	   at OpenSubtitles.OpenSubtitleDownloader.SearchSubtitlesAsync(OpenSubtitleQuery[] queries, CancellationToken cancellationToken)
	   at OpenSubtitles.OpenSubtitleDownloader.Search(SubtitleSearchRequest request, CancellationToken cancellationToken)
	   at Emby.Providers.Subtitles.SubtitleManager.SearchSubtitles(SubtitleSearchRequest request, CancellationToken cancellationToken)
	Source: System.Private.Xml
	TargetSite: Void Throw(System.Exception)
	

This one seems different, adds more info to the exception "Data at the root level is invalid"

Link to comment
Share on other sites

solidsnakex37
39 minutes ago, Luke said:

HI, please attach the complete emby server log file. Thanks.

Hey Luke! I just sent it over in a PM, thanks for taking a look!

Link to comment
Share on other sites

HI, please try removing these plugins:

	Episode Refresh 1.0.0.1
	Playback Reporting 2.0.1.0
	Samsung Smart Things 1.0.0.4

Then restart the server and see how things compare. Thanks.

Link to comment
Share on other sites

  • 3 weeks later...
solidsnakex37
On 11/2/2023 at 11:20 PM, Luke said:

HI, please try removing these plugins:

	Episode Refresh 1.0.0.1
	Playback Reporting 2.0.1.0
	Samsung Smart Things 1.0.0.4

Then restart the server and see how things compare. Thanks.

Hey Luke, 

I've removed all of the above plugins as requested, though today I am seeing that large spike in RAM usage again. The other day it was as high as 40GB, right now I am seeing it again at 20GB. 

I've sent you the latest server logs, sorry I would post here but I am finding that the logs have IPs of my current users and the hostname of my server (I wish this would be redacted in the anonymize logs setting). 

Thanks again for your help with this, Happy Thanksgiving! 

Link to comment
Share on other sites

solidsnakex37

Something else I just noticed, I am seeing ffmpeg-remux log files? I've been using Emby for at least a year, I don't think i've ever come across a remux log? I've only ever seen transcode logs, wanted to mention this in case this may be a factor in the high RAM usage. 

image.png.8d8886a178d09d03572bb6b2aa214668.png

Though, everything should be going to /tmp which I have mapped to a cache drive in Unraid. 

image.png.13a541ab2bb370f885426f6f4d0dbb9c.png
image.png.7305c9fa2b866d13bd788dac452d9ef2.png

Edited by solidsnakex37
added more info
Link to comment
Share on other sites

solidsnakex37

Usage just went from 20GB to 32GB so it seems to fluctuate. I tried restarting the Emby server through the UI (Admin Dashboard) but that RAM usage remained? Seems like the restart option in Emby isn't a full restart. 

If I restart the Emby Server container, this resets RAM usage. 

I personally don't mind if Emby uses a good amount of RAM, the issue is just when it runs off and causes my whole server to freeze up. Last week it went up to 40GB and maxed out my system memory and my Unraid UI become unresponsive. I could still get into Emby so I shutdown the Emby server from there. 

Link to comment
Share on other sites

jaycedk

/tmp is a ram drive in unraid.

My guess is that you are using that as your transcoding drive.

Try to use something else, just as an test.

And report back.

Link to comment
Share on other sites

solidsnakex37
45 minutes ago, jaycedk said:

/tmp is a ram drive in unraid.

My guess is that you are using that as your transcoding drive.

Try to use something else, just as an test.

And report back.

Well I have /tmp mapped to a transcode share, do you mean change the container mapping to something like /temp as well as in Emby? 

Link to comment
Share on other sites

solidsnakex37
9 minutes ago, jaycedk said:

Hmm might have miss read that, sorry about that.

 

No worries! I wondered about that though, I posted a pic of my container mapping and the emby mapping just incase. Though it doesn't seem to increase when transcodes are happening, sometimes I don't see any transcodes or playback activities and the jobs don't appear to be running anything 🤔 at least the UI isn't reporting it. 

Link to comment
Share on other sites

  • 1 month later...
solidsnakex37

I found that when the high RAM usage was occurring, there are loads of intro detection processes taking place. Though, no tasks appear to be running in the dashboard, despite this process running. 

It looks like this was resolved in the latest beta version of Emby server. 

  • Fix Intro Detection scheduled task not being visible

Listed under 4.8.0.63 Beta 
https://github.com/MediaBrowser/Emby.Releases/releases

I believe this is my issue which is fixed. I can't wait for the next stable release of Emby Server. So many improvements. I might have to play around with the Beta release! 

  • Thanks 1
Link to comment
Share on other sites

  • 1 month later...
solidsnakex37

I am having this issue again, Emby container is consuming large amounts of RAM and causing my entire array to be unresponsive.

If you look at my netdata chart, Emby consumed a total of 48GB of RAM. Every 30 minutes in the chart, it continued to consume around 8GB of RAM. 

I've attached the server log from around this time stamp. 

I am running the latest version now, 4.8.1.0 in Docker. 

This has happened 3 times over the last 48 hours and took me a bit to figure out this was Emby again. 

The log was large, so I just cut out the parts prior to the graph increasing and left the startup details. The logs cover about 20 min before the RAM spike.

If you want the full log, it's 15MB 80,000 lines, but I can provide it. (just been an issue in the past).

Graph below is from 19:39-23:05 where it drops (thankfully, the container seemed to have crashed or something and not my whole server this time). 

image.thumb.png.6dc58e235a7fb654f264f70f1fdc09bf.png

embyserver-63843897600.txt

Edited by solidsnakex37
correction
Link to comment
Share on other sites

Lessaj

I'm not sure if this is causing it but something I see here is it looks like a lot of your NFO files under cinema have an invalid structure. This one for example is Atlantis: The Lost Empire. You can try to look at the NFO and see if the date on it has changed recently, could try to throw it into an XML validator to see if there's something missing. Can also maybe delete the NFO and refresh metadata on this item and see if it has a error after?

2024-02-18 20:57:26.874 Info LibraryMonitor: cinema (/media/movies/cinema) will be refreshed.
2024-02-18 20:57:27.210 Info HttpClient: GET https://api4.thetvdb.com/v4/movies/768/extended?meta=translations
2024-02-18 20:57:27.339 Info HttpClient: GET https://api.themoviedb.org/3/movie/10865?api_key=x_secret9_x&append_to_response=alternative_titles,reviews,casts,releases,images,keywords,trailers&language=en-US&include_image_language=en-US,en,null,en
2024-02-18 20:57:27.535 Error App: Error reading existng nfo
	System.Xml.XmlException: System.Xml.XmlException: Data at the root level is invalid. Line 176, position 1.

 

Link to comment
Share on other sites

solidsnakex37
3 minutes ago, Lessaj said:

I'm not sure if this is causing it but something I see here is it looks like a lot of your NFO files under cinema have an invalid structure. This one for example is Atlantis: The Lost Empire. You can try to look at the NFO and see if the date on it has changed recently, could try to throw it into an XML validator to see if there's something missing. Can also maybe delete the NFO and refresh metadata on this item and see if it has a error after?

2024-02-18 20:57:26.874 Info LibraryMonitor: cinema (/media/movies/cinema) will be refreshed.
2024-02-18 20:57:27.210 Info HttpClient: GET https://api4.thetvdb.com/v4/movies/768/extended?meta=translations
2024-02-18 20:57:27.339 Info HttpClient: GET https://api.themoviedb.org/3/movie/10865?api_key=x_secret9_x&append_to_response=alternative_titles,reviews,casts,releases,images,keywords,trailers&language=en-US&include_image_language=en-US,en,null,en
2024-02-18 20:57:27.535 Error App: Error reading existng nfo
	System.Xml.XmlException: System.Xml.XmlException: Data at the root level is invalid. Line 176, position 1.

 

That is strange, looking at the .nfo file, Line 176 is <micodec>dts</micodec>

If I run it through a XML validator, it's not finding any errors. 

image.png.14f3969cb64649823b054dafb6d9eb28.png
Atlantis The Lost Empire (2001) [imdbid-tt0230011] - [Remux-1080p][DTS-HD MA 5.1][AVC]-FraMeSToR.nfo

Link to comment
Share on other sites

Lessaj

Was this NFO recently updated? Could be a red herring error if it just replaces the NFO. I'm also seeing a lot of RTM refreshes for cinema folder, if you have anything in this root folder that kept changing that might cause that. Ideally there should only be folders under this folder. Otherwise beyond that it's mostly showing subtitle download attempts.

Link to comment
Share on other sites

solidsnakex37

 

Just now, Lessaj said:

Otherwise beyond that it's mostly showing subtitle download attempts.

So 2 out of the 3 times this occurred over the weekend, my entire server had to be rebooted. This last event (last night, in the graph above), I was able to get into my server and open Emby after a few attempts, it dropped to 15GB usage and things came back up, the only task I saw running in the dashboard was Download Subtitles. There was no library scan or anything else. I had suspected before when this first occurred it was an issue downloading subtitles, but I can't prove it. 

That .nfo file was modified around 8:57 (20:57), at least that's the date modified on the file. 

In my server log file I attached, there are 1255 hits for Error Reports over that 4 hour period, which is a lot. They seem to vary between: 

Error SubtitleManager: Error searching for subtitles on Open Subtitles
Error App: Error sending web socket message Sessions
Error App: Error reading existng nfo
Error Trakt: Exception handled sending status update
Error Notifications: Error sending notification

I am going to kick off the download subtitles task and see if I can replicate the behavior and see

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

solidsnakex37

I haven't been able to replicate it manually, however I just got an alert that Emby is consuming over 35GB of memory again. There are no tasks running on the dashboard. No streams running. I've attached the server log, and screenshot below showing the same incremental increase over a 2 hour period. 

 

 

emby7.png

emby8.png

embyserver (4).txt

Link to comment
Share on other sites

Hi, please try removing these plugins:

2024-02-23 14:23:01.360 Info App: Loading Emby.Bulky, Version=1.0.20.0, Culture=neutral, PublicKeyToken=null from /config/plugins/Emby.Bulky.dll
2024-02-23 14:23:01.360 Info App: Loading Emby.Plugins.AniSearch, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null from /config/plugins/Emby.Plugins.AniSearch.dll
2024-02-23 14:23:01.360 Info App: Loading MediaBrowser.Plugins.Anime, Version=1.5.6.0, Culture=neutral, PublicKeyToken=null from /config/plugins/MediaBrowser.Plugins.Anime.dll
2024-02-23 14:23:01.360 Info App: Loading playback_reporting, Version=2.1.0.5, Culture=neutral, PublicKeyToken=null from /config/plugins/playback_reporting.dll

Then restart the server and see how things compare.

Link to comment
Share on other sites

solidsnakex37
8 minutes ago, Luke said:

Hi, please try removing these plugins:

2024-02-23 14:23:01.360 Info App: Loading Emby.Bulky, Version=1.0.20.0, Culture=neutral, PublicKeyToken=null from /config/plugins/Emby.Bulky.dll
2024-02-23 14:23:01.360 Info App: Loading Emby.Plugins.AniSearch, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null from /config/plugins/Emby.Plugins.AniSearch.dll
2024-02-23 14:23:01.360 Info App: Loading MediaBrowser.Plugins.Anime, Version=1.5.6.0, Culture=neutral, PublicKeyToken=null from /config/plugins/MediaBrowser.Plugins.Anime.dll
2024-02-23 14:23:01.360 Info App: Loading playback_reporting, Version=2.1.0.5, Culture=neutral, PublicKeyToken=null from /config/plugins/playback_reporting.dll

Then restart the server and see how things compare.

Removed the following and will keep monitoring further: 

Bulky 1.0.20.0
AniSearch 1.0.1.0
Anime 1.5.6.0
Playback Reporting 2.1.0.5

  • Thanks 1
Link to comment
Share on other sites

  • 3 weeks later...
solidsnakex37

The plugins above are still removed, however I am seeing the same behavior again today. The blue is the Emby container, this is over the last 6 hours. 

Current status: 
No scans are showing in the dashboard
Only direct streams are currently in progress
Current RAM usage is 34GB
Current logs attached 

image.thumb.png.d942824cad7cac8e6d7372a43103b49d.png

image.thumb.png.15f0a754b51335f092caf9286b5c1888.png

embyserver (15).txt

Link to comment
Share on other sites

solidsnakex37

I continued to monitor it and around an hour or two after my post above, it climbed to around 62GB+ of usage, then just dropped back to normal RAM usage. 

image.png.a9b4fcd21a769220268fd71f99767354.png

Link to comment
Share on other sites

Hi, that's interesting. Thanks for the update.

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...