Possible memory leak in PVR Live TV?
#1
(my apologies if this is the wrong area, please feel free to move if necessary)
Environment:
Windows 7-64 (newly built), i3-3225 with 8GB RAM, XBMC 12.2
Both XBMC and PVR backend are running together on this same machine, connecting to an HDHomerun Prime tuner
All of the tests below were using HD channels from Comcast (USA)

I'm hoping to get some dev attention on a possible memory leak that's been confirmed by a few people over in the WMC PVR thread in the PVR Support forum (http://forum.xbmc.org/showthread.php?tid=171216). This may be Windows specific, but it's been confirmed in both WMC and NPVR, in 12.2 as well as Gotham.

While watching Live TV with the WMC add-in for a few hours the other night, I happened to turn on Task Manager (via remote desktop, another user account) and was quite surprised to see the XBMC process using around 700 megs of RAM. Further, I watched it steadily grow to about 900 megs over the course of an hour while watching TV. So I ran some more tests, moving to the stock Confluence skin, restarting XBMC, and monitoring the RAM usage of the XBMC process with Windows Performance Monitor. I let the home screen sit overnight, and then fired up Live TV for over an hour the next morning. I found that the steady increase in memory usage is reproducible, it grows by about 3MB per minute, and even worse the memory is not released after Live TV is stopped. Following is a chart showing the XBMC.exe RAM usage during this test (which uses the WMC PVR add-in). This test starts Live TV playback at about 7:00am, then stops close to 8:30am. It's sitting on the main menu before and after:
Image

So I installed NPVR, disabled WMC and the MCE services, and tried the same test. I found that it happens with NPVR as well:
Image

In contrast, following is what a chart looks like when I play a normal high definition MKV file:
Image

Now, of course you're thinking "this guy has a borked environment". But three other people in the WMC thread have confirmed it and one of them confirmed on Gotham as well. Granted, they are only using the WMC add-in, and I am the only one who has tested in NPVR.

Any thoughts or tests that I can perform to help confirm, troubleshoot or diagnose? Has anyone else noticed this before? I do not know if this would happen on other OS's, so it's possible that it's Windows only.

Thanks.
Reply
#2
its absolutely possible that there is a mem leak, so it would make sense to run it through some memory tester like valgrind.
Seems there is also a windows port now: http://sourceforge.net/projects/valgrind4win/

Surely there are other tools for this, Visual Studio has some plugins for it too afaik.
Reply
#3
Thanks wsnipex, much appreciated. When it comes to coding and development, I'm a tinkerer. However I'll try to find some time to set up a profiling tool and we'll see where it leads. In the meantime, I'm personally back to the nightly restart task in Windows, which I suppose could be an appropriate workaround for any other Windows PVR users.

I also have some Openelec-based clients so I'll run top for a while to see if I can reproduce to problem in an embedded Linux environment.
Reply
#4
can you reproduce this with 12.3-pre builds and/or with a nightly?
Reply
#5
(2013-11-22, 22:11)wsnipex Wrote: can you reproduce this with 12.3-pre builds and/or with a nightly?

I was able to reproduce it with the gotham nightly 20131118, with the wmc pvr.
Windows Media Center PVR addon (pvr.wmc) and server backend (ServerWMC)
http://bit.ly/serverwmc
Reply

Logout Mark Read Team Forum Stats Members Help
Possible memory leak in PVR Live TV?0