[mythtv] Mythcommflag eats memory

Joe Votour joevph at yahoo.com
Wed Aug 31 21:22:26 UTC 2005


I don't know if that's related or not either, but you
might want to try running valgrind on mythcommflag. 
It's helped me out immensely on the stuff that I write
(both personally and professionally).

Something else you can try, is to do this command:
echo 2 > /proc/sys/vm/overcommit_memory
Then run mythcommflag in gdb.  When it tries to malloc
memory that isn't there, you'll get the address (of
where the program segfaults from the failed malloc). 
If you have a debug build, you can get the line
number, which might be a start to look at.  Valgrind
is much better though.

Something is definitely going on there.  I've never
actually looked at the console output of any of the
programs, and I have 512MB of RAM, plus at least that
in swap space (maybe even 1GB of swap), so it's quite
likely that mythcommflag would complete without
running out of RAM.  After that happens, the
per-process heap should be cleaned out and returned to
the system, so I wouldn't see any of those problems.

Gotta love the malloc implementation in glibc:
"By  default,  Linux  follows an optimistic memory
allocation strategy. This means that when malloc()
returns non-NULL there is  no  guarantee that  the 
memory  really  is available. This is a really bad
bug." (from the man page of malloc).

Then again, it's better than malloc/free in vxWorks
which results in a completely fragmented heap if you
malloc/free too often with too many sizes.  Six of
one, half a dozen of the other, I guess...

-- Joe

--- Torbjörn Jansson
<torbjorn.jansson at mbox200.swipnet.se> wrote:

> mythtv-dev-bounces at mythtv.org <> wrote:
> > Recently mythcommflag have started to eat loads of
> memory for
> > some reason.
> > When i looked the memory usage was around 800Mb or
> so and then it gets
> > killed by the oom killer, but not before the oom
> killer kills
> > mythbackend. 
> > 
> > Any one else seen this? Or have any clues why it
> happens?
> > 
> 
> And another thing, recently i've been getting a few
> lines like:
> 
> *** glibc detected *** free(): invalid pointer:
> 0x080a6038 ***
> *** glibc detected *** free(): invalid pointer:
> 0x080a6038 ***
> *** glibc detected *** free(): invalid pointer:
> 0x080a61c8 ***
> *** glibc detected *** free(): invalid pointer:
> 0x080a6190 ***
> *** glibc detected *** free(): invalid pointer:
> 0x080a61d8 ***
> 
> On the shell where i have mythbackend running.
> I don't know if it's related or not.
> 
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
>
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
> 



		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 


More information about the mythtv-dev mailing list