[mythtv-users] Possible Memory Leak?

Ray Olszewski ray at comarre.com
Tue Jun 17 07:46:45 EDT 2003


While the CVS version of Myth certainly *might* have a memory leak, I don't 
think either of these reports is (yet) evidence that it does. When you 
(Ken) say "The program eats and eats ram", and you (Timothy) say " I can 
watch the memory used gradually grow" ... what *exactly* are you seeing?

I ask because by one measure commonly used, *any* Linux system will see its 
memory use "grow and frow" until all RAM is in use. That measure is memory 
use as reported by "top", or, equivalently, the first line of the report 
from "free". Those listings count as "used" memory that is assigned to 
buffers and cache. The Linux kernel will create more buffer and cache 
whenever it can, to speed up (probabilistically) future access to data or 
running of apps.

But cache and buffer memory is readily available if needed. (Or should be; 
if it is not, you have a problem at the kernel level, not the Myth level.)

OTOH, if you are basing this report on either the *second* line of the 
output of "free" (which subtracts cache and buffer space), or on the 
specific line in "top" that reports memory used by mythfrontend, then you 
may have something  and should describe the details of what you see.

Bottom line: it really pays to be specific in these reports.

BTW, Ken, what you "hear" about "free" is incorrect. Perhaps you were 
thinking of "top"?

Just to be clear ... these two reports do indicate that some sort of 
problem is present. But without more detail, identifying that problem as a 
memory leak seems to me premature. Isaac likes backtraces, but if the 
system really "hangs tight", they may be tough to come by. One useful thing 
to do in such cases is to run "top" in an ssh session, so when the system 
hangs, you still have a readable display of the last state "top" reported 
and can see (for example) --

         if overall memory really is nearly full
         if the system is using swap
         how much memory each of the top-running processes is using 
individually
         what CPU load was like just before the system hung

At 09:08 PM 6/17/2003 -0400, Ken Thompson wrote:
>I've seen the same problem... EXACTLY the same problem.  I'm using 256MB
>of ram in which it never recovers.  The program eats and eats ram till
>the operating system jerks its leash to free up some memory. (2 MB)  I'm
>not sure what exactly is causing it, if you use the command "free" I
>hear, it will show you which process is chowing down on your RAM.  Hmm,
>in the past week I've heard lots of people talk about this bug/memory
>leak.  I wonder if any of the devs have seen it also.
>
>My specs,
>Duron 900
>256MB PC133
>Geforce 4 MX440
>Soundblaster Audigy
>Mandrake 9.1
>Mythtv 0.9.1
>Ivtv (the latest)
>Alsa Sound (the latest)
>
>
>
>-----Original Message-----
>From: mythtv-users-bounces at snowman.net
>[mailto:mythtv-users-bounces at snowman.net] On Behalf Of Timothy Vann
>Sent: Tuesday, June 17, 2003 8:50 AM
>To: Mythtv-Users (E-mail)
>Subject: [mythtv-users] Possible Memory Leak?
>
>I've just setup MythTv  for the first time and I seem to have a memory
>leak.  I'm running with a PVR-250, 512MB of ram and 512MB swap.
>Basically, everything starts up fine and runs for a few hours, then my
>system hangs tight because I'm out of memory.  I can watch the memory
>used gradually grow and killing off mythbackend doesn't recover the
>memory(hence why I think it's a leak).  If I don't start mythtv then the
>box runs fine.  At this point I'm not sure if the leak is comming from
>MythTv or from the ivtv driver.  Just thought I'd see if anyone had seen
>this same problem or had any suggestions.







More information about the mythtv-users mailing list