Memory Leak Tvservice | Page 3

Discussion in 'fixed TV-Server / Client Bugs' started by SciDoctor, June 21, 2007.

  1. the_it_bloke

    the_it_bloke Portal Member

    Joined:
    April 22, 2007
    Messages:
    9
    Likes Received:
    0
    Ratings:
    +0 / 0
    Guys

    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
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. SciDoctor
    • Team MediaPortal

    SciDoctor Retired Team Member

    Joined:
    February 2, 2005
    Messages:
    1,465
    Likes Received:
    128
    Location:
    England
    Ratings:
    +138 / 0
    Show System Specs
    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.
     
  4. W_Z

    W_Z Portal Member

    Joined:
    April 6, 2007
    Messages:
    13
    Likes Received:
    1
    Ratings:
    +1 / 0
    Home Country:
    Canada Canada
    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. :)
     
  5. the_it_bloke

    the_it_bloke Portal Member

    Joined:
    April 22, 2007
    Messages:
    9
    Likes Received:
    0
    Ratings:
    +0 / 0
    :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
     
  6. infinite.loop
    • Team MediaPortal

    infinite.loop Retired Team Member

    Joined:
    December 26, 2004
    Messages:
    16,163
    Likes Received:
    3,861
    Gender:
    Male
    Location:
    127.0.0.1
    Ratings:
    +4,154 / 7
    Home Country:
    Austria Austria
    Show System Specs
    I can confirm this issue. "Record every time on every channel" is causing a memory leak.

    i have added it to ::mantis::

    :D for testing! :)
     
  7. Broceliande
    • Team MediaPortal

    Broceliande Retired Team Member

    Joined:
    April 26, 2006
    Messages:
    186
    Likes Received:
    2
    Ratings:
    +2 / 0
    Just fixed it , will be in the very next revision (>15154)
     
  8. SciDoctor
    • Team MediaPortal

    SciDoctor Retired Team Member

    Joined:
    February 2, 2005
    Messages:
    1,465
    Likes Received:
    128
    Location:
    England
    Ratings:
    +138 / 0
    Show System Specs
    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)
     
  9. the_it_bloke

    the_it_bloke Portal Member

    Joined:
    April 22, 2007
    Messages:
    9
    Likes Received:
    0
    Ratings:
    +0 / 0
    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
     
  10. SciDoctor
    • Team MediaPortal

    SciDoctor Retired Team Member

    Joined:
    February 2, 2005
    Messages:
    1,465
    Likes Received:
    128
    Location:
    England
    Ratings:
    +138 / 0
    Show System Specs
    I'll post my logs in another twelve hours when the test period ends.
     
  11. sixgun
    • Premium Supporter

    sixgun MP Donator

    Joined:
    March 31, 2008
    Messages:
    80
    Likes Received:
    12
    Occupation:
    Software Developer
    Ratings:
    +12 / 0
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    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.
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!