Jump to content

Emby Theater Memory usage


csadoian

Recommended Posts

csadoian

I am using Emby Theater 2.8.1 on a Windows 7 Professional computer, Core i7 3.4Ghz, 8GB memory and an Nvidia GeForce GTS 250 video card.

 

I previously posted a topic in the Windows area about Emby Server eating memory when used with external players.  I worked around that issue by just using the internal players on whatever platform I am using at the time.

 

However, today I noticed something strange on my Windows machine running Emby Theater.  I have two monitors on this PC, so I had fired up Emby Theater on one monitor and was watching a program on live TV.  After about 45 minutes my PC appeared to be operating a bit sluggish, so I brought up task manager and was surprised to see a process called mpv.exe using 2.1GB of memory.  Apparently mpv.exe is the player that is used by Emby Theater internally.

 

In any case, the huge amount of memory used by the program surprised me, so I went to Emby Theater and used the back arrow at upper left corner to close the program I was watching.  The process mpv closed and gave all it's memory back to Windows.  So I opened the live TV channel again and mpv appeared again the in the task list, consuming about 100MB of memory, but as I watched the memory consumed slowly started to increase.  After 1/2 hour it had climbed to over 1GB.  I'd hate to think how much memory it would consume if I watched a 2 or 3 hour live program.  Assuming memory usage would continue to rise there would be a point my PC would run out of memory and either crash or become unusable.

 

I then closed the live channel, closed and re-opened Emby Theater and then started playing an HD program I had recorded previously from Live TV.  Emby is saving the files in MPV format.  While the recorded program was playing I noted a similar increase in memory usage, although it didn't appear to be as drastic as what was happening with Live TV.  After playing the recorded program for about 20 minutes, the memory consumed by mpv.exe had increased from around 100MB to about 350MB, and was rising very slowly.

 

I am not using any acceleration or special settings in Emby Theater (i.e. it's using the default settings).

 

Would this be a bug in mpv, especially when it is playing a live stream? 

 

 

Link to comment
Share on other sites

Ok sorry I misread your post a little. 

 

Yes it seems that when playing live tv, in order to able seeking of the live broadcast mpv will keep a cache in memory. You're saying it's a 2.1gb, it shouldn't go too much higher because we've configured a cap around that amount. Once you stop playing it will go down.

Link to comment
Share on other sites

csadoian

Ok, I"m running a test right now since I'm watching a Nascar race, should go for at least 2 hours.  The Live TV channel is 1080p and is being supplied by the HD Homerun Prime.  Running in a window (not full screen).

 

Started at 2pm, 144mb.  We'll see how high it goes.  :)

 

Chuck

Link to comment
Share on other sites

csadoian

25 minutes later 2GB.

 

35 minutes later 3GB

 

45 minutes later 3.7GB, appears to be leveling off.

 

60 minutes later 3.8GB, seems to have stopped increasing. 

 

So it would seem that at 1080p the live buffer will be approx 40-45 minutes (as least on my computer).

 

What does the process "Electron" do?

Link to comment
Share on other sites

It's not the electron process, it's what I said in post #4. 

 

 

 

Yes it seems that when playing live tv, in order to able seeking of the live broadcast mpv will keep a cache in memory. 

 

So yes this is a little high although it will clear once playback is complete. We will continue to review the size of it and adjust to find the right amount. Thanks.

Link to comment
Share on other sites

csadoian

It's not the electron process, it's what I said in post #4. 

 

 

So yes this is a little high although it will clear once playback is complete. We will continue to review the size of it and adjust to find the right amount. Thanks.

 

I was just wondering what the process does.  When running Emby Theater I see the processes "Emby.Theater.exe*32", "electron.exe" and "mpv.exe" (the latter when playing something).  I was just wondering what it's purpose was.

 

Also, you said "in order to able seeking of the live broadcast mpv will keep a cache in memory".  I took that to mean there is a live buffer, like a regular DVR has, that allow you to seek back in the program to when you first started playing it, or as far back as the size of the buffer, say 30 minutes.  That doesn't appear to be true.  When I try to drag the slider backwards it always returns to the point of current live stream.

 

Understand I'm not complaining, just trying to understand how it's designed to operate.  I've read much of the docs and Faqs, but because of ongoing development the operation of the software doesn't alway match up with the existing documentation.  :)

Link to comment
Share on other sites

I don't see any problems seeking live tv but will continue to test, thanks.

Link to comment
Share on other sites

csadoian

I played around with seeking just now and was able to get it to go back about 5 minutes, then forward but each time the picture froze for upwards of a minute or so until it started playing again.  I actually though it was locked up but decided to be patient and it eventually started playing again. 

 

Click on rewind or fast-foward has the same effect.  Huge pause, then it begins playing again.

 

Maybe it has something to do with my hardware.

 

If I STOP the player for a minute, then click play it picks right up.  But clicking on the seek bar either way or the rewind/fast-foward buttons causes a huge pause.  mpv.exe had a 1.1GB memory allocation during the time I was testing.

 

I just tried it on my Android box and the rewind/fast-forward controls work as expected (no long pausing).

Link to comment
Share on other sites

I tested this just now by playing for a few minutes, and then I was able to seek back into content that had already played without any problems. One area of opportunity for improvement is visual indication of the seekable length. Right now you can't see it, and if you try to seek outside of the seekable boundary then it's not going to work.

Link to comment
Share on other sites

Guest asrequested

It's not the electron process, it's what I said in post #4. 

 

 

So yes this is a little high although it will clear once playback is complete. We will continue to review the size of it and adjust to find the right amount. Thanks.

 

Maybe an option to choose where the buffer gets stored? It would great to have this moved to an SSD. I run a lot of software on my HTPC, keeping the system memory available is important. Plus, moving it to an SSD will allow for a much larger buffer. 

Link to comment
Share on other sites

It's handled by mpv and I haven't seen such configuration in it's documentation.

Link to comment
Share on other sites

Guest asrequested

It's handled by mpv and I haven't seen such configuration in it's documentation.

 

Ah! Right, maybe I'll dig into that and see if I can find a way...if one exists

Link to comment
Share on other sites

tried that, look at the wording. it says "create a cache file". it doesn't say replace in memory cache with file cache.

Link to comment
Share on other sites

Guest asrequested

tried that, look at the wording. it says "create a cache file". it doesn't say replace in memory cache with file cache.

 

But doesn't this imply that everything will be stored there?

 

"When the general cache is enabled, this file cache will be used to store whatever is read from the source stream."

Link to comment
Share on other sites

csadoian

A little more follow up for you ...

 

Uninstalled all traces of Emby Theater for Windows.  Then installed a fresh copy.

 

Tuned to a live TV channel, 1080p HD.  After 1 minute of waiting I clicked the rewind and it responded fairly quickly.  Waited 5 minutes, then tried it again.  This time there was a very noticeable pause, then the video resumed.  The longer I was tuned to the channel (and thus, the larger the memory cache being using by mpv), the longer of a pause/freeze when I used the seek controls.

 

Then I tuned to an SD channel (720 x 480).  Let it play for about 5 minutes and then used the seek controls and there was no pause that I could see.  After waiting another 5 minutes used the seek controls again and there was a short pause/freeze.  The longer I watched, the more obvious the pauses were becoming.

 

It would seem that the larger the memory buffer grows in mpv, the more of a pause I see when operating the seek controls.  One would think with the buffer kept in memory it shouldn't take very long to seek to a given point in time, but on my system it sure does.

 

With mpv using 500MB there is an approximate 2 second pause in the video whenever I use the seek controls on the Live SD channel.

Link to comment
Share on other sites

Guest asrequested

When I tried it, it did not prevent memory usage from growing.

 

That's a pity. On the upside, now I have a reason to buy more memory :D

 

And just a little nudge, it'll be great when we get the buffer indicator on the progress bar.

Link to comment
Share on other sites

the 2 second pause is because we are using the -hr-seek option with mpv to force accurate seeking. without that i had trouble getting it to work.

Link to comment
Share on other sites

csadoian

If it was 2 seconds all the time, that would be great.  But my tests indicate that the larger the buffer mpv has going the larger the delay, sometimes minutes, which gives the impression is player is locked up.  For example, if I watch an HD channel for 45 minutes and hit the rewind button (set to the default 15 seconds) the player will pause for what seems like forever (minutes) and then finally resume at the correct point (15 seconds back).  Only occurs in Windows.  Haven't observed this behavior in Android.

 

I'm puzzled why this behavior doesn't occur in your tests.

Link to comment
Share on other sites

csadoian

Strange.  I just loaded Emby Theater on my laptop running Windows 10.  I then tuned to an live HD channel, let it play for 5 minutes and when I clicked on rewind the picture froze for 12 seconds and then resumed at the proper place.  Let it play another minute, hit rewind and the picture froze for 16 seconds.

 

The laptop is running Windows 10 64-bit version 1703 (Creators).

 

By the way, after I installed Emby Theater each time I launch it the box "The Visual C++2015 Runtime will now be installed" pops up.  I hit ok and immediately Emby Theater opens.  In checking under Programs & Features I see C++ Runtimes 2005, 2008, 2010 and 2012 are already installed on this laptop, but 2015 is not.  Is the runtime provided with Emby Theater compatible with Windows 10 Creators Edition?

 

Regardless of Visual C++ Runtime 2015 being installed or not, Emby Theater seems to run fine.  It just pops up the box each time I launch the program.

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