Universalmediaserver: 10.4.1: Bad memory leak on Mac

Created on 15 Apr 2021  Â·  11Comments  Â·  Source: UniversalMediaServer/UniversalMediaServer

Since somewhere in the 10.x range of releases, I've been seeing a very bad memory leak with UMS to the point that I have to "Force Quit" UMS and restart it every few days. I never had to do this with UMS 8.x or 9.x, which I'd often leave running for weeks and would only restart when upgrading to a new UMS release. This on my Mac running High Sierra.

In the most recent example, after 4 days of running, the memory used by UMS 10.4.1 went from ~30 MB to over 1.2 GB. My UMS debug.log file shows a lot of these:

INFO  2021-04-15 17:19:29.534 [AWT-EventQueue-0] Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space

At that point, UMS's UI became unresponsive to clicks, so clicking on the Quit button did nothing and I had to "Force Quit" the application.

All 11 comments

@esabol thanks for reporting this. Are you able to try running the initial v10 release so we can see if it was introduced there, or in some release after?
I am trying to get better with Java memory profiling so this is a good reason to keep going

At the very bottom of the UMS window, I see a single line which shows messages like “Getting API Info for _mkv file name_”. This line seems to be fairly new, post-9.8.3 certainly. These messages oddly slightly rearrange the layout of the UMS window vertically, which is weird and unwelcome. When I see a lot of these messages, I notice that the Memory Usage bar just keeps on growing. What is “Getting API Info” doing exactly?

It's looking up metadata about the files as they scan, for example to get the posters for thumbnails, actors, directors, ratings, etc.

It's looking up metadata about the files as they scan, for example to get the posters for thumbnails, actors, directors, ratings, etc.

Well, it seems to be doing it for every single file in every shared directory tree, and it seems to be storing all this information in memory. And it keeps doing it until it runs out of memory.

Why is it doing this? Posters, actors, directors, ratings: none of that is visible in my TV’s DLNA interface. Is this for the UMS web interface? I don’t use that. Is there an option to turn this off? I just want to be able to watch videos on my TV using DLNA.

That information is available via DLNA. For example in the Media Library folder you can filter movies and TV shows by genre. An overview of the v10 changes is at https://github.com/UniversalMediaServer/UniversalMediaServer/wiki/Version-10-Release-Notes

You can disable it via the Navigation Settings tab, by disabling the "Get info from our API" setting.

I am still interested in figuring out this memory leak though. I haven't experienced that on my machine - I am still able to do the scan with the API enabled and leave the server running for weeks.

Please let me know if disabling the API setting changes the memory leak for you.

That information is available via DLNA. For example in the Media Library folder you can filter movies and TV shows by genre.

OK, but I have "Enable the Media Library" option disabled.

An overview of the v10 changes is at https://github.com/UniversalMediaServer/UniversalMediaServer/wiki/Version-10-Release-Notes

Yeah, sorry, I'm just not interested in any of those features, honestly. It's not what I need or want from a DLNA server. Anyway...

You can disable it via the Navigation Settings tab, by disabling the "Get info from our API" setting.

Cool. I think the option is labeled "Use info from our API" (close enough!). I've disabled it.

I've also disabled the options for audio and DVD ISO thumbnails (because I don't have any of those).

I am still interested in figuring out this memory leak though. I haven't experienced that on my machine - I am still able to do the scan with the API enabled and leave the server running for weeks.

That would be nice. I restarted UMS this afternoon, and, just a few hours later, the memory usage was up to 700 MB in use.

Please let me know if disabling the API setting changes the memory leak for you.

Will do.

OK, but I have "Enable the Media Library" option disabled.

Some features work outside of the Media Library too, like the poster thumbnails, so that's why it's a separate setting.

Yeah, sorry, I'm just not interested in any of those features, honestly. It's not what I need or want from a DLNA server. Anyway...

Cool, that's totally fine, and that's why we aim to make settings to disable features users don't want

I think we have a winner. One day later, the "Memory Usage" bar in UMS actually shows 39 MB, slightly less than what it showed shortly after I started UMS yesterday (43 MB, IIRC). Contrast that with the 700+ MB it showed after just 3-4 hours of running before I turned off the "Use info from our API" option.

That's good news, it narrows that down. I will try to reproduce but I couldn't last time. Can you please reenable the setting and attach TRACE logs, or send them to me on the forum?

Sorry, I'm not willing to share my logs without heavy redaction, and it's just too much effort for anything but a targeted snippet. The log contains just tons and tons of messages from OpenSubtitles background workers, if that helps.

> grep OpenSubtitles ~/Library/Application\ Support/UMS/debug.log.outofmemory.log | wc -l
  556484
> grep OpenSubtitles ~/Library/Application\ Support/UMS/debug.log | wc -l
       0

Ok. I understand your position, but it doesn't leave me with much to work with if I can't reproduce the problem. I'll still try to reproduce it some more, but if I can't, I will have to close this issue until someone with logs comes along

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SubJunk picture SubJunk  Â·  4Comments

drakulis picture drakulis  Â·  8Comments

Nadahar picture Nadahar  Â·  4Comments

esabol picture esabol  Â·  6Comments

maciekberry picture maciekberry  Â·  8Comments