Jump to content

Memory leak with guide update


revengineer

Recommended Posts

revengineer

I have done extensive testing with the live TV guide update feature in windows emby server v3.0.5724.5, and can conclude that there is a memory leak in that procedure. High memory usage has been reported in several posts and may or may not be related to this issue, so I am starting a new thread. 

 

My testing was as follows: This morning I started my server and initial ram usage was 300 MB. I then did a guide update and memory usage went up to 500 MB. 

 

I then restarted the emby server, memory usage went back to 300 MB. I watched portions of movies switching between resolutions (quality) and also watched some TV. Memory usage varied during this, going up to 500 MB. However, when I finished viewing, usage went back to 300 MB. Many hours later in the evening usage was still 300 MB. Then I did another guide update and memory usage went back up to 500 MB and did not go back down.

 

In another thread, it was mentioned that 500 MB is common usage. So I restarted the emby server, memory usage back at 300 MB. Then I did a first guide update and memory went back up to 500 MB. I did second guide update and memory usage went to 700 MB. This pretty conclusively demonstrates the presence of a memory leak.  

 

It looks like the progress bar goes twice to 100% during the guide update process. During the first run, the log shows access to json.schedulesidrect.org.This is when most of the memory increase occurs. During the second pass amazonaws is accessed. Memory is pretty stable during this pass. This info should narrow down where the leak occurs.

 

I have attached my log, although there seem to be no errors associated with the leak.

server-63578855547.txt

Link to comment
Share on other sites

revengineer

Interesting, just when I thought I had it figured out, this morning memory usage was back down to 500 MB. It looks like I am back to square one trying to figure out where I rack up 1.2 GB memory usage before emby server becomes non-responsive.

Link to comment
Share on other sites

revengineer

To continue the monologue, I updated the guide again, memory went from 500 MB to 700 MB. Interestingly, 30 minutes after completion of the guide update, memory is still 700 MB. Maybe the issue is that memory does not get released fast enough and that multiple scheduled tasks and viewings simply require too much memory for a 32-bit application. In this case the near term solution may be to move to a 64-bit application. In the long term it may be possible to reduce the memory foot print of the various tasks.

 

Ok, enough wise suggestions from a newbie. I will let the devs digest this info. There may be something useful hidden in here.  :)

Link to comment
Share on other sites

revengineer

What platform are you running Emby server on?

 

Which Live TV application are you using?

Emby server is running on Windows Server 2012 Essentials. I tried life TV on both the web client and the Android app. I do have the emby client on FireTV and Roku as well, but I am not using it much for testing at this point.

Link to comment
Share on other sites

revengineer

Not sure what you mean with using emby TV. i use the live TV feature of emby. i have an HDHomerun with 3 cablecard tuner receiving 400 channel. I watch TV through the emby web client and the emby android app. 

 

Note on the side: I flipped through the channel lineup on the android app and memory went temporarily from 500 MB to 1 GB. It did go back down with some delay.

Link to comment
Share on other sites

revengineer

ah yes, correct, only built-in TV functionality. The only plugins installed are coverart, folder sync, rotten tomatoes reviews, and server configuration backup.

  • Like 1
Link to comment
Share on other sites

revengineer

That's what I am hoping for. I think bits and pieces of my experience have been reported in other posts. However, as I find myself, the behavior is not that simple and straight forward to reproduce.

 

Not sure if the following makes sense: If there are two many subtasks requesting memory that is not quickly enough release, memory usage can sky rocket. At this point out of memory errors start occurring and things go downhill from there. I have applied the 4GB patch to the server executable and I have not seen any out of memory errors recently. Hower, I have not stressed the server heavily enough to get the memory usage back to its previous peaks.

 

I will report back if I find more clues

Link to comment
Share on other sites

revengineer

One last report for today on live TV high memory usage. Here the scenario. I was watching live TV on the emby android app on my phone. Then I tried starting another live TV program on emby theater on my windows 7 box. The latter would not start. At the same time the TV program froze on the android phone, leaving an orphaned ffmeg process on the server. I killed the ffmpeg process. The emby server service then started using between 25-90% of the cpu for about 7 minutes. During this time, memory usage grew from 500 MB to 1.7 GB. The logs do not show out of memory errors, possibly due to application of the 4 GB patch. 30 minuted after the the incident, memory usage still has not changed, the 1+ GB additional allocation was not freed, so I assume this is a leak. 

 

The logs are attached. The problem started at ~6:40 pm.

 

EDIT: This problem is partially reproducible. The high CPU is caused by trying to watch live TV in emby theatre, which consistently fails. The high CPU usage then causes the freezing on the android app, so the latter is a symptom but not the cause. What was not reproducible is the high memory usage. Maybe someone looking at the logs will find an additional factor.

server-63578946886.txt

transcode-77858e93-74ff-4559-b2f6-af7e5a6d81a2.txt

Edited by revengineer
Link to comment
Share on other sites

revengineer

I think I am seeing a similar problem on my end as well.  I periodically have to restart Emby Server service to get my HTPC responsive again.

A few more details would be helpful. E.g., is this related to live TV as well? Is this reproducible? If so, how? Do you have any logs you can provide?

Link to comment
Share on other sites

A few more details would be helpful. E.g., is this related to live TV as well? Is this reproducible? If so, how? Do you have any logs you can provide?

 

I'm not really sure what it is related to yet, but I do use LiveTV via ServerWMC & a Ceton card.

 

Earlier today the HTPC was performing so slowly I RDP'd in to take a look.  It was paging w/ the task manager claiming MediaBrowser.ServerApplication was using over 800mb.  Based on your first post, I decided to remove my SchedulesDirect account info, remove the existing EPG data, and restart the service.  The process seems to now have its memory usage settle around 300mb.

 

I'll keep monitoring it.

Link to comment
Share on other sites

farside847

After my first out of memory unhandled exception I started tracking my memory use for the past week.

Every day the server seems to grow by 50 to 100mb in memory. Currently it is at 750mb while running for a week without reboot. It started at 350mb. Slow leak?

Server is running on win7, with the serverwmc plug in, with live TV schedule update once a day. Tuner is a HD home run cable card with 200 channels. I use the roku client. Other plug-ins include the roku trickplay, theme songs and previews.

I am thinking of moving to the built in tuner support but I keep putting it off since the serverwmc solution has been working for a year.

Let me know if any logs would help.

Edited by farside847
Link to comment
Share on other sites

revengineer

I am seeing something similar. With hardly any usage average ram usage is now 700 MB, up from 500 MB yesterday. It's peaking at 1.1 GB at the moment. I am using the built-in tuner support.

 

Without some developer input I don't think we can do much. I have detailed as much of my testing as I could. But it's apparently not sufficient to warrant a response. Somewhat frustrated...

Link to comment
Share on other sites

mediacowboy

I am seeing something similar. With hardly any usage average ram usage is now 700 MB, up from 500 MB yesterday. It's peaking at 1.1 GB at the moment. I am using the built-in tuner support.

 

Without some developer input I don't think we can do much. I have detailed as much of my testing as I could. But it's apparently not sufficient to warrant a response. Somewhat frustrated...

I feel your pain. I tried to get someone to look at this before it went public but it seemed no one listened. Now that you and others have stepped forward I was hoping for some improvement.

Link to comment
Share on other sites

revengineer

I feel your pain. I tried to get someone to look at this before it went public but it seemed no one listened. Now that you and others have stepped forward I was hoping for some improvement.

Thank you for the mental support. Since you seemed to have a fair amount of experience with this product, while I have used it for less than 2 weeks, are these issues limited to live TV? In other words, did you have similar issues prior to EmbyTV being added to the product? 

Link to comment
Share on other sites

mediacowboy

No I didn't but I find the frustration worth it when the wife cant live with out the software now. I will say don't give up on it to quick or just because of this issue. They do listen they just have a lot on their plates.

Link to comment
Share on other sites

revengineer

I wasn't planning on giving up, I think the software has potential. I may just have to ditch the live TV feature for now if I cannot find anyone who is willing to work with me to resolve the issue. My server typically runs for months at a time without intervention. Over the last week I log in several times daily to babysit the rogue emby process, and this is trying my patience.

Link to comment
Share on other sites

We know there is some sort of issue here but it isn't an easy fix and is fairly limited (I know, that doesn't do you much good since you are part of the group it affects).

 

For now, there is a Server Restart plug-in in the catalog.  Perhaps installing that and having it schedule a re-start late at night when no one is using the system will be a stop-gap so you don't have to babysit it.

  • Like 2
Link to comment
Share on other sites

mediacowboy

For now, there is a Server Restart plug-in in the catalog. Perhaps installing that and having it schedule a re-start late at night when no one is using the system will be a stop-gap so you don't have to babysit it.

Running the dev version has gotten me around the need for the server restart issue. So that is a stop gap for now.

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