Memory Leaks?


JP

Recommended Posts

I can't say this is the best sub-forum to post this question to since I'm not entirely sure what the root cause is for my memory leaks.  Years ago when I started unRAID it was very stable for many years.  Then maybe a year ago (a guess) I noticed the server would freeze up and I didn't really have any indication why.  It could go maybe a month or two and then the issue would happen again.  Over time I discovered that the memory usage was increasing over time.  I thought this might have been due to the fact I was on a somewhat older version of the OS, but about two weeks ago I upgraded to 6.6.7 and the issue persists.  My server has only 4 gigs of RAM, but it went years without these memory leak issues so I'm not exactly sure what to attribute them to.  I have only maybe 4 dockers and Plex does appear to take quite a bit more memory than the rest, but restarting it doesn't free up much memory at all.  It is only when I reboot that the memory completely clears and then over time it starts to tick back up again.  Have others been seeing something similar?  Any thoughts on where I should start to try and determine the root cause?  Thanks for any help.  

Link to comment

Not experienced anything remotely like that. My server only ever reboots for OS upgrades, typically going for 180+ days. I'm still running on 6.5.3, so uptime would have been since June 2018 if it weren't for power outage of 1 hour or longer.

 


root@UNRAID:~# uptime
 19:50:16 up 178 days,  5:14,  1 user,  load average: 0.12, 0.08, 0.03

Edited by BRiT
Uptime stats included
Link to comment
If you are able to see that memory usage is increasing over time try disabling dockers and see if it stops increasing. If you work systematically you'll be able to determine which one is the culprit.


I did this when I was trying to figure out a server lockup. Turned out to be Radarr.

I fixed it by limiting the containers memory.

Edit the container and add
—memory=xG


To “extra parameters“
(Where x equals a value you are comfortable with).

Hope this helps.

Link to comment

Thanks so much for this Bill.  As I've been researching this more it appears these memory leak issues are more common than I realized and what you provided appears to be the fix in many of the cases.  I put in the extra parameters as you mentioned for my Plex docker and it seems to only be creeping up a bit.  Plex definitely appeared to be taking up the most memory and spiking from time to time so I suspect it wasn't releasing the memory as it should be for whatever reason.  I'll be monitoring it and hopefully this resolves things.  Thanks again.

Link to comment
  • 3 weeks later...

I am really struggling with this.  I'm all but certain the culprit is Plex.  Any other docker will take up memory space of 1% or less as it runs, but Plex will creep up over time and eventually cause the overall memory allocation to go to 100% and bring the server to almost a full stop.  As soon as I STOP Plex the memory will drop for 100% to about 46%.

 

I tried using the "--memory=1G" command in the extra parameters and didn't have much luck.  The first time I did this I didn't notice much difference, but I may not have given it enough time.  IT takes days to actually creep up the memory.  So then I attempted to change the extra parameter and for some reason Plex did not like what I entered.  I received an error as it attempted to APPLY the command and my Plex docker completely disappeared.  This wasn't necessarily a bad thing since I thought maybe something had gotten corrupted with Plex so I decided to completely rebuild the docker.  I deleted the entire Plex folder on my cache drive and then re-installed Plex using a completely different Plex docker.  This time I tried binhex's version instead of linuxiso's.

 

The result came back the same.  The same memory leaks issues persisted.  I again tried to apply the "--memory=1G" command and that seems to sort of work, but what seems to happen is that Plex will cap my memory's capacity at around 75%, but it still doesn't release the memory so the net result is the same.  Specifically, last night I was attempting to play some 4K home videos I had on the server via Plex and they just wouldn't play.  I then went and took out the extra parameter ("--memory=1G") and then they played fine.  I'm not really sure what to do now.

 

The odd thing is that Plex was working fine probably until about six months ago.  For years Plex and the other dockers just worked.  I do have a fairly meager server so I'm wondering whether the software itself has outpaced my equipment and I need some kind of upgrade.  I only have 4 GB of RAM on the server, but again, in the past everything seemed to work fine and I knew I wouldn't be asking any more from it.  I would put in 16 or 32 GB of RAM if I thought this might resolve matters, but I'm wondering whether this would just prolong the memory leak issue rather than resolve it.  It could just continue to grab memory and not release it as it is now.  If it would simply release the memory then I suspect the server would work as it always has.  

 

Any thoughts or guidance is greatly appreciated.   

Link to comment
  • 3 months later...
On 3/25/2019 at 9:09 AM, JP said:

I am really struggling with this.  I'm all but certain the culprit is Plex.  Any other docker will take up memory space of 1% or less as it runs, but Plex will creep up over time and eventually cause the overall memory allocation to go to 100% and bring the server to almost a full stop.  As soon as I STOP Plex the memory will drop for 100% to about 46%.

 

I tried using the "--memory=1G" command in the extra parameters and didn't have much luck.  The first time I did this I didn't notice much difference, but I may not have given it enough time.  IT takes days to actually creep up the memory.  So then I attempted to change the extra parameter and for some reason Plex did not like what I entered.  I received an error as it attempted to APPLY the command and my Plex docker completely disappeared.  This wasn't necessarily a bad thing since I thought maybe something had gotten corrupted with Plex so I decided to completely rebuild the docker.  I deleted the entire Plex folder on my cache drive and then re-installed Plex using a completely different Plex docker.  This time I tried binhex's version instead of linuxiso's.

 

The result came back the same.  The same memory leaks issues persisted.  I again tried to apply the "--memory=1G" command and that seems to sort of work, but what seems to happen is that Plex will cap my memory's capacity at around 75%, but it still doesn't release the memory so the net result is the same.  Specifically, last night I was attempting to play some 4K home videos I had on the server via Plex and they just wouldn't play.  I then went and took out the extra parameter ("--memory=1G") and then they played fine.  I'm not really sure what to do now.

 

The odd thing is that Plex was working fine probably until about six months ago.  For years Plex and the other dockers just worked.  I do have a fairly meager server so I'm wondering whether the software itself has outpaced my equipment and I need some kind of upgrade.  I only have 4 GB of RAM on the server, but again, in the past everything seemed to work fine and I knew I wouldn't be asking any more from it.  I would put in 16 or 32 GB of RAM if I thought this might resolve matters, but I'm wondering whether this would just prolong the memory leak issue rather than resolve it.  It could just continue to grab memory and not release it as it is now.  If it would simply release the memory then I suspect the server would work as it always has.  

 

Any thoughts or guidance is greatly appreciated.   

Did you ever get this sorted out? I'm experiencing this issue. 

Link to comment

Sort of.  I'm surprised more people aren't seeing this because it remains on my server as plain as day.  Additionally, the solution I'm using isn't very elegant at all, but it works so I'll take it as a half-win.  Here is all I did:

 

1)  Increased Memory-  I think I increased my memory to 32 gigs.  I don't run that much and my hope was that this would give my server so much extra space that as Plex became bloated, at least the problem of running out of memory would take more time to reach.

 

2)  Setup PLEX to receive auto-updates.  Each time PLEX is updated it has to stop and restart the docker itself.  This clears the memory and allows for the memory leak cycle to reset.  Fortunately, PLEX receives updated pretty frequently, maybe every week or so.  This frequent cycle really helps with the problem.  

 

These two items coupled together have basically returned my server to the state I once I had it at before this issue, that is, I just don't anything with it (for the most part).  It simply does its job again without me having to do hardly any routine maintenance.  Love unRAID :)   

Link to comment
  • 4 weeks later...

I have a similar problem with binhex-medusa, I've noticed it using over 10GB before. Today I've added the max memory parameters so I'll see how that works but I'd be interested to know what I can do to find the underlying problem. I saw elsewhere someone saying medusa leaks because of the python version , but I'm not sure if it's possible to update python in unraid

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.