Java Heap Size Errors

For help and support with Universal Media Server
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply
boss
Posts: 348
Joined: Thu Jun 30, 2016 1:07 pm

Java Heap Size Errors

Post by boss »

Every few days my devices cannot see UMS. I have UMS running on a Linux server.
When I check my server, UMS is still actually running.
The UMS logs always show a Java error when this happens:
DEBUG 2017-12-27 20:19:12.159 [HTTPv2 Request Worker 4] Caught exception: Java heap space
INFO 2017-12-27 20:21:05.341 [cling-2380] Exception in thread "cling-2380" java.lang.OutOfMemoryError: Java heap space
INFO 2017-12-27 20:21:07.284 [cling-2376] Exception in thread "cling-2376" java.lang.OutOfMemoryError: Java heap space
INFO 2017-12-27 20:21:20.611 [SocketListener(satan-itsbiz-com-au.local.)] Exception in thread "SocketListener(satan-itsbiz-com-au.local.)" java.lang.IllegalStateException: Timer already cancelled.

My Java heap space was previously 512M and now I have set it to 1024M to see if it resolves the issue.

What is the general consensus:
heap space - 512M was to small
Or
UMS has a memory leak

Interested to hear thoughts.
Thanks
Nadahar
Posts: 1990
Joined: Tue Jun 09, 2015 5:57 pm

Re: Java Heap Size Errors

Post by Nadahar »

UMS doesn't have a memory leak in the traditional sense, but it keeps the metadata for all browsed or scanned media in memory and it is never freed. It depends on how large your media library is, and on how you use it. You don't mention which version you're using - 7.0.0 isn't "stable" yet and has several issues, one of which has to do with this.
boss
Posts: 348
Joined: Thu Jun 30, 2016 1:07 pm

Re: Java Heap Size Errors

Post by boss »

I'm using 6.7.4.

My library is not very big at all. Or maybe it is. It is 620GB and 28,000 files with the most in Photos.
And this error happens when not in use.
EG: Using UMS and all going fine. Don't use it for 3 days and then it isn't shown on the devices and the error in the logs.
Nadahar
Posts: 1990
Joined: Tue Jun 09, 2015 5:57 pm

Re: Java Heap Size Errors

Post by Nadahar »

Can you let it run in "trace" mode for 3 days, and then upload the debug files? The log might indicate what it's doing that's causing this.
boss
Posts: 348
Joined: Thu Jun 30, 2016 1:07 pm

Re: Java Heap Size Errors

Post by boss »

Will do. I will change the heap size back to the default as it was when the problem was happening and set the log to TRACE mode.

Thanks
boss
Posts: 348
Joined: Thu Jun 30, 2016 1:07 pm

Re: Java Heap Size Errors

Post by boss »

@ Nadahar

I have the log file in TRACE mode.
But... The log file is 950MB and the ZIP file of it is 44MB.

Should I attach the 44MB ZIP file or is that too big?
Nadahar
Posts: 1990
Joined: Tue Jun 09, 2015 5:57 pm

Re: Java Heap Size Errors

Post by Nadahar »

I don't think the forum will accept that. Is there somewhere you can upload it and add a link here?
boss
Posts: 348
Joined: Thu Jun 30, 2016 1:07 pm

Re: Java Heap Size Errors

Post by boss »

I have uploaded the zip file to a file sharing service here:
https://ufile.io/fcrz6

From what I can work out, it happens if I watch quite a few videos one after the other.
Whilst I continue to watch the videos it is ok. But when I stop, the next time I start one of my renderers they don't see UMS.
And that's when the Java Heap Size Errors are in the logs.

Thank you.
boss
Posts: 348
Joined: Thu Jun 30, 2016 1:07 pm

Re: Java Heap Size Errors

Post by boss »

bump
Nadahar
Posts: 1990
Joined: Tue Jun 09, 2015 5:57 pm

Re: Java Heap Size Errors

Post by Nadahar »

I can't open the log file in a normal text editor because of its size, so I have to find some software that can open it. Looking through a 950 MB logfile is bound to take some time anyway, so don't hold your breath.
Post Reply