freevo-devel

I'm running an AMD64 system w/ a gig of mem and Gentoo. About 3-4 weeks
ago, I emerged Freevo 1.5.2, bypassing the mask. After leaving Freevo
running for about 5-6 days, I thought to myself how great it was to have
so much mem that I never run into swap; I thought I would run 'free' and
boost my ego by observing the zero swap-usage. Much to my amazement,
about half my swap was being used. My first guess was that X was using
the memory, so I killed that, which killed every other program I was
using. Still, swap was being used. As a last resort, I ran
'/etc/init.d/freevo stop'. Lo and behold, my swap partition (512M) was
emptied and I got about 600 free megs of free phys memory(reported by
'free').
I gave such a long story because from what I read on the web, Linux
users tend not to believe that their programs are leaking, preferring to
blame the output of top,free or whatever memory usage reporting tool
there is (I mean no offense to anyone here; I use Linux exclusively
myself). The fact that I ran into swap (with a gig of memory and
running only firefox, xemacs, aterm, and xfce), however, is hard proof
that freevo is leaking something.
If I look at the output of top, freevo starts with about 21M of resident
memory. From my unscientific, non-rigorous observation, this value
(resident memory) increases each time it records something. Usually,
after 1 day (about 3-4 shows, on average), the resident memory usage
goes to about 100 and never decreases. I restart freevo manually about
once a day now; if I do not do this, it goes to 200, 300, and on; there
is no chance that I could run it for more than a week. I was not using
the webserver when I ran into swap, though I do use it currently.
The good news is that now that I know freevo is leaking, I can restart
it and never run into swap; the bad news is that I am soon taking a
2-week trip to India and will not always have an internet connection to
restart freevo. As it is, in addition to the xml_tv update script, I'll
have to put /etc/init.d/freevo restart in my crontab, or I'll simply run
out of memory+swap; on a 32-bit system, it might even exhaust the 4GB
address space.
I didn't report this bug because earlier I thought other people would
definitely notice it (as most people don't have a gig of mem). However,
since others have not reported it, I believe it may be specific to
amd64; perhaps a pointer is being stored in an int?
Thank you for reading this very long message,
Jonathan Thambidurai

I seem to have found the memory leak, sorta. Further testing has shown that the memory usage (observed by 'top' resident memory) increases a few megs per each 1/2 hour of recording. Looking through the code, I saw that there was some code that created a thread to read the output of the recording process. On a hunch, I disabled the output of mencoder using the '-quiet' switch and then managed to record a 1/2 hour without leaking a single meg of memory (mencoder continually dumps its status to stdout).
There is still a bug in freevo, however. When the recording process is finished, whatever memory was used to hold its output should be freed, right? Well, it isn't; that is likely why over the course of a few recordings, my memory usage with the default output of mencoder skyrocketed.
If you want to be sure of this bug, make your recording command "cat /dev/urandom" or something similar; I suspect you will notice the leak very quickly.
At least now I won't have to put '/etc/init.d/freevo restart' in my daily crontab.
Thank you to all who took the time to read this,
Jonathan Thambidurai
On Fri, 10 Dec 2004 19:52:58 -0500
Jonathan Thambidurai <jonthambi@...> wrote:
> I'm running an AMD64 system w/ a gig of mem and Gentoo. About 3-4 weeks
> ago, I emerged Freevo 1.5.2, bypassing the mask. After leaving Freevo
> running for about 5-6 days, I thought to myself how great it was to have
> so much mem that I never run into swap; I thought I would run 'free' and
> boost my ego by observing the zero swap-usage. Much to my amazement,
> about half my swap was being used. My first guess was that X was using
> the memory, so I killed that, which killed every other program I was
> using. Still, swap was being used. As a last resort, I ran
> '/etc/init.d/freevo stop'. Lo and behold, my swap partition (512M) was
> emptied and I got about 600 free megs of free phys memory(reported by
> 'free').
>
> I gave such a long story because from what I read on the web, Linux
> users tend not to believe that their programs are leaking, preferring to
> blame the output of top,free or whatever memory usage reporting tool
> there is (I mean no offense to anyone here; I use Linux exclusively
> myself). The fact that I ran into swap (with a gig of memory and
> running only firefox, xemacs, aterm, and xfce), however, is hard proof
> that freevo is leaking something.
>
> If I look at the output of top, freevo starts with about 21M of resident
> memory. From my unscientific, non-rigorous observation, this value
> (resident memory) increases each time it records something. Usually,
> after 1 day (about 3-4 shows, on average), the resident memory usage
> goes to about 100 and never decreases. I restart freevo manually about
> once a day now; if I do not do this, it goes to 200, 300, and on; there
> is no chance that I could run it for more than a week. I was not using
> the webserver when I ran into swap, though I do use it currently.
>
> The good news is that now that I know freevo is leaking, I can restart
> it and never run into swap; the bad news is that I am soon taking a
> 2-week trip to India and will not always have an internet connection to
> restart freevo. As it is, in addition to the xml_tv update script, I'll
> have to put /etc/init.d/freevo restart in my crontab, or I'll simply run
> out of memory+swap; on a 32-bit system, it might even exhaust the 4GB
> address space.
>
> I didn't report this bug because earlier I thought other people would
> definitely notice it (as most people don't have a gig of mem). However,
> since others have not reported it, I believe it may be specific to
> amd64; perhaps a pointer is being stored in an int?
>
> Thank you for reading this very long message,
> Jonathan Thambidurai
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> Freevo-devel mailing list
> Freevo-devel@...
> https://lists.sourceforge.net/lists/listinfo/freevo-devel