Memory Leak Tvservice (1 Viewer)

the_it_bloke

Portal Member
April 22, 2007
9
0
59
Guys

Over a period of days my memory usage for TVService fills my available RAM (1GB) until the O/S can't run properly and eventually the machine dies.

Thanks for your assistance, but the issue I had was related to the TVServer service taking up all the available RAM and not the MSSQL database application.

During the course of a few days from a reboot this issue happened consistently regardless of OS (XP or 2K3 Server) or indeed database type (MSSQL or MySQL).


I now seem to have resolved the issue, by completing the following;

1) I changed the aerial - the signal was not ideal and did cause very occasional dropout, although this may be a red herring

2) I removed all the 'Record this program everytime on every channel' presets - this is more significant.

Previous posts have indicated the issue may be related to the EPG. The issue I noticed with my 2GHz processor was that the TVServer service accessed the SQL database every 17 seconds (peak of around 10% processor usage) when I had a number of one-off and 'Record every time on this channel' presets.

When I setup a number of 'Record everytime on every channel' presets as well the TVServer service makes a significantly higher number of table requests to the database (whichever one is used) every 17 second. The processor peaks at up to 100% and the more of this type of recording, the longer the processor stays at 100% causing even more live program and recording dropouts.
This could be either causing an issue once again with dropouts interupting the video flow, or in some way related to the EPG system and its database access. Either way the service can't release RAM and bloats.

By removing all the 'Record everytime on evey channel' presets, the processor once again dropped to 10% peaks.

3) Following another post, I found the Microsoft tool which allowed the TVServer service priority to be increased to High (NOT REALTIME) which ensures the service gets priority and according to other posts seems to make the system run more smoothly.

I think there is definately an issue (with my system) with the TVServer service accessing the database and doing a lot of record searches when 'Record Everytime on Every channel' is selected.
Whilst it is possible that my 2GHz processor is underpowered when used as a server, I think the SQL searches could be refined to spread the load and perhaps run a little less than every 17 seconds, perhaps user selectable, or hourly?

Is there anyone able to replicate this??? or better still, is anyone able to rectify the issue???


Thanks
 

SciDoctor

Retired Team Member
  • Premium Supporter
  • February 2, 2005
    1,465
    139
    England
    Well spotted and confirmed that the 'everytime on every channel' is the memory leak culprit.

    Running the latest SVN all day and the tv service memory usage was toping out at over 1GB and knowing that I was near to a .net service crash I checked my schedules in the SetupTV and noticed I had three 'everytime on every channel', the other twenty six are single instance or 'everytime on this channel'.

    I used the MP GUI to delete these ofending schedules while still having the task manager open (been open all the time for monitoring this problem) and after deleting these the memory usage and VM lowered by over 900K to 98K/108K within a minute, peak mem still showed the 1+GB.

    I'll monitor this further but all indications are a rogue thread leaking memory while checking for the 'everytime on every channel' schedules.
     

    W_Z

    Portal Member
    April 6, 2007
    13
    1
    Home Country
    Canada Canada
    Well spotted and confirmed that the 'everytime on every channel' is the memory leak culprit.

    I removed my 'every time on every channel' schedules (I have no idea how to completely remove the schedule using the GUI; had to use the sql management studio) and things seem to be back to normal so far. It's been about 10 hours and memory usage is around 50mb for tvservice instead of 1gb+ as it would normally be by now.

    Thanks for finding this one. Add another one for the devs. :)
     

    the_it_bloke

    Portal Member
    April 22, 2007
    9
    0
    59
    :D Thank you, I work in IT so praise is very rare :)

    There definately seems to be 2 related or unrelated issues associated with the Record every time on every channel option.

    There is a memory leak issue and the peak processor usage every 17 seconds (which you guys with nice fast processors probably are not noticing).

    Some other things I have done and observed;
    Since moving to MySQL (never used it before but installation was simple) my RAM allocation in Windows Task Manager for mysql-nt.exe is approx 15MB all the time. With MSSQL it constantly varied from 50 - 110MB.

    I have stopped collecting the EPG for any channels I dont need (before I collected for everything) and this further reduced the 17second processor utilisation peak.

    I removed all the radio channels (which I was not specifically collecting EPG info for) and this again for some reason marginally reduced the 17second processor utilisation peak which is odd. I wonder if there are records in the Database for the radio channels even though EPG data is not collected.

    The system is now stable, has not crashed in 3 days (a record) the TVServer service has not taken more than 100MB RAM and is falling back to 43MB when nothing is happening. So I am convinced this is the cause.
    Problem is I use this feature to capture old episodes of shows which are occasionally/randomly repeated as fill-in's on the less popular channels, so I am already missing this service.

    Does this post need to be moved somewhere more prominent for someone to pick it up???

    Regards
     

    SciDoctor

    Retired Team Member
  • Premium Supporter
  • February 2, 2005
    1,465
    139
    England
    I am still seeing memory leaks with the TV server with the latest svn's since the fix. I haven't addded any 'on every channel' schedules.

    The memory leak isn't as quick but after a couple of days uptime causes the memory minimum usage to be about 400-500k and will not reduce to the normal 50-70k that was used at the TVservice start.

    I am testing svn 15207 at the moment. (remember it is a two day uptime test)
     

    the_it_bloke

    Portal Member
    April 22, 2007
    9
    0
    59
    D'OH
    That's a shame. I upgraded to 15155 the day it came out and I have not had a reocurance of the issue myself so far.
    My TVService.exe goes up to around 80MB when recording and returns to around 50MB when idle.
    Also, since moving to My-SQL the database takes only 15MB.
    I have tried the any/any schedules and they also seem to be behaving themselves from a memory leak point of view.
    That said I still have not added any any/any schedules as the anoying 17second processor peak has not gone away and this is still made worse by the any/any schedules.

    I'm just glad i have reached a point of stability. Sorry you are still having problems :-(

    Regards
     

    SciDoctor

    Retired Team Member
  • Premium Supporter
  • February 2, 2005
    1,465
    139
    England
    I'll post my logs in another twelve hours when the test period ends.
     

    sixgun

    MP Donator
  • Premium Supporter
  • March 31, 2008
    80
    12
    Home Country
    United Kingdom United Kingdom
    Is this still an issue. I am using the RC1 version in a multi-seat situation and noticed my TvService memory usage was just over 1GB on my dedicated server, I thought nothing of it at the time. But, when I actually tried loading the clients they just hung on the "loading window plugins" bit. When I killed the TvService and ran the SetupTv (which restarts it), all was fine again. Also, nothing seemed to record for a while. I did use the radio very briefly a few days before this, so maybe it was that.

    I don't think I have any all channels recordings set up. What is the best way to check that? I've looked in the TV Schedules part of the Setup app and they all say Type=Always, Keep=All

    I'm going to be keeping an eye on the server for the time being.

    Regards.
     

    Users who are viewing this thread

    Top Bottom