TvService crashes after exceeding 1,3GB memory (1 Viewer)

HakanThn

Portal Pro
February 24, 2009
76
6
Home Country
Sweden Sweden
My TvService crashes after some days running.
The memory usage gradually increases, and when it exceeds 1300MB, the TvService stops responding.

What could cause this?
Attached logs from MP debug mode.

I´ve had a lot of problems with TvService crashes, and solved the worst by TvServer patch and Tv-card update (see https://forum.team-mediaportal.com/mediaportal-1-2-0-beta-540/tv-server-crash-97731/index3.html).
Hope someone can help me with this last one to :)
 

MrCrabs

Portal Pro
January 21, 2010
884
129
Braunschweig
Home Country
Germany Germany
The cause is probably that the tvserver calls memory and doesn't give it free once it isn't needed anymore. But I can't tell you where that comes from, if it is your configuration or a bug, I don't know. So you will need to wait for one of the devs to have a look at this. Sorry if it seemed like I got a clou, just didn't want that your thread stays unnoticed.
 

mm1352000

Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    MrCrabs is right - it does sound like a memory leak. Please restart the PC and then check whether memory usage starts to constantly increase. Also try to use the TV Server test section and see whether memory usage increases when the test has been running for a long time.

    mm
     

    HakanThn

    Portal Pro
    February 24, 2009
    76
    6
    Home Country
    Sweden Sweden
    Yes, memory usage constantly increases. I´ve had this issue for a long time, and have made many PC restarts...

    Not sure what you mean by "TV server test section", but tried to make a test.
    Using "test channels" function in TV-server setup:
    (No MediaPortal client active during this test)
    Time................................Memory usage
    Before start.....................165564kB
    After 7 min.......................182376kB
    After 15 min.....................198776kB (stopped test here)
    5 min after stopped test:206460kB (EPG grabbing continued until this point)
    5 min later, idle tuners:...213052kB

    Conclusion: Memory usage increases constantly, even when all tuners are idle. The increase rate in this test seems higher than "usual".


    It seems also that MP client plays a role. When I use MP in debug mode, it can take more than a week to reach the crash limit 1,3GB. When I use Purevision HD + some plugins it usually only works a few days.
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Thanks HakanThn - yes the "test channels" section is what I meant. :D

    Something is not right there. Your comment about the MP client having an effect is very interesting. Could you list all the plugins (both TV Server and MP) that you have installed. Also, I'm wondering whether EPG grabbing or teletext is having any effect. When you say that you've had this problem for a long time, does that mean that it didn't always happen - it started with a certain MP version or plugin or something.
     

    HakanThn

    Portal Pro
    February 24, 2009
    76
    6
    Home Country
    Sweden Sweden
    Thanks for you help, mm1352000, your awesome in this forum! :D

    Enabled plugins, TV server:
    Powerscheduler and WebEPG

    Enabled plugins, MediaPortal:
    HTPC Info, InfoService, MP-TV Series, Extensions, Radio, TV, Play Disc, Home, Music, Pictures, Settings, Sudoku, Tetris, Topbar, Videos, Weather, Powerscheduler client,

    Installed, incompatible plugins (disabled):
    Skin Info, Blu-ray Handler, Fanart Handler, Keyboard Input Plugin, MayaBasic Home config, Skin Translations

    Many MP plugins are old, and need an update. Might be some incompatible plugins that have not been automatically disabled, since some old plugins are not listed as installed in the MPEI (e.g. MP-TV series). I am planning to do a fresh MP install one of these days...
    However, since TV server eats memory also when no MP client is active, this should not be the cause? Also, I have the problem also in MP debug mode.
    Actually, today has been the fastest rate of memory build up that I´ve ever seen, and I´ve only used MP in debug mode. It could be that the observed fast rate when using Purevision HD was simply a coincidence.

    I don´t know if this problem has always happened. I have always had MP problems, and I´m narrowing them down and eliminating them step by step. Last year I understood that most problems related to TV-server crashes. Since then I´ve solved two TV server problems, and now I´ve noticed this consistent memory leak.

    I know I´ve tried to shut of EPG grabbing and it didn´t help, but maybe that was before I solved the hardware problem though... Teletext I have not tried. But, since it seems the memory leak is on going also when all tuners are idle, could EPG or teletext still be the cause?
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Hi again

    Thanks for you help, mm1352000, your awesome in this forum!
    I just hope that I can help with this problem - memory leaks are sometimes very hard to track down. Memory usage is not logged. The best thing to do is generally to strip back to basics as much as possible. If you are willing then it would be an *excellent* idea to try and use a memory profiler (like this - free trial and tutorials) to track down the source of the leak.

    However, since TV server eats memory also when no MP client is active, this should not be the cause? Also, I have the problem also in MP debug mode.
    I understand - just trying to get an idea of your setup. The leak is on the TV Server side but it can be triggered by plugins on MP side if they are TV related. What you can do is restart TV Server and see if the leak starts immediately. For me, memory usage is *very* steady when I'm not tuning.

    I don´t know if this problem has always happened. I have always had MP problems, and I´m narrowing them down and eliminating them step by step. Last year I understood that most problems related to TV-server crashes. Since then I´ve solved two TV server problems, and now I´ve noticed this consistent memory leak.
    Okay. The only other memory leak that I recall being reported in the past 6 months (or more) is -->here<--. We didn't get very far with tracking down that problem, but rlevis is quite active on the forum so if you PM him and ask whether he still has the problem then I'm sure he will respond.

    I know I´ve tried to shut of EPG grabbing and it didn´t help, but maybe that was before I solved the hardware problem though... Teletext I have not tried. But, since it seems the memory leak is on going also when all tuners are idle, could EPG or teletext still be the cause?
    I don't think you can turn off teletext, however teletext is only available with some channels. Question would be: does the leak occur if you don't tune channels with teletext (so the teletext parser is never started)?

    Leaks can have different behaviours. For example, if there was a leak in the tuning process then the memory usage would increase each time you change channel. A different kind of leak (that sounds like what you have) would be a leak in a background thread/process that is running even when you're not watching/recording TV. The main background processes in TV Server that I can think of are the EPG grabbers (DVB, XMLTV etc.), Powerscheduler, streaming server... I think that is all I can think of at the moment. You can only eliminate the EPG grabber and powerscheduler, but a leak in the streaming server *should* be less likely since I'd have expected more people to have this problem if it was that (also, you don't seem to have a multi-seat setup so the streaming server is not actively used).

    mm
     

    HakanThn

    Portal Pro
    February 24, 2009
    76
    6
    Home Country
    Sweden Sweden
    I´ll try out your ideas one by one. A first quick test:
    1. Just restarted TvService, without performing any EPG grabbing or tuning. After 10 minutes, everything is still fine, memory usage is pending between 15 and 19MB.
    2. Started timeshifting a channel from TVserver setup (DVB-S). Memory usage starts growing! After 3 minutes, memory usage is 28MB.
    3. Stopped the timeshifting. Memory usage is still increasing!!
    4. Restarted TvService - memory usage back to normal
    5. Started timeshifting a different channel from TVserver setup , on a different TV-card (DVB-T). Same result, memory usage starts growing. This time though it seems it does not continue to grow after stopping the timeshifting - but the used memory is not released.

    Seems that tuning a channel is giving problems. Need to retest, to verify if it continues after stopping the timeshifting. Need also to test with channels without teletext. But another day, long over night time now...
    Memory profiler is interesting, but would be a lot of work to learn to handle I think. I´ll turn to that if other tests don´t succed.
    Thanks again for your help!
     

    Users who are viewing this thread

    Top Bottom