[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Tracking allocated memory (was: Tracking memory leaks -- advice  needed)
From:       iglio () fub ! it (Pietro Iglio)
Date:       1999-06-23 15:01:53
[Download RAW message or body]



>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

On 6/23/99, 4:28:04 PM, Harri Porten <porten@tu-harburg.de> wrote 
regarding Re: Tracking allocated memory (was: Tracking memory leaks -- 
advice  needed):


> Pietro Iglio wrote:
> >
> > ... then kpanel enters in the event-loop with 433k allocated. As you
> > can see, KApp
> > and the registry stuff are allocating about 250k, i.e. more than 50%
> > of the memory
> > allocated for kpanel on startup! I suspect that QApplication is
> > largely responsible
> > for that, isn't it?

> I got:

>  KApplication: ~70kB
>  QApplication: ~98kB

> kpanel was the first app from KDE_1_1_BRANCH I instrumented
> withfprintf()'s for alloc_current. Needless to say that it leaks 
memory
> constantly. The most trivial observation: on each
> kPanel::slotUpdateClock() the amount of allocated memory increases by
> 100-150 bytes _without_ any user interaction.

> We should start an initiative to eliminate such leaks for the most
> important apps that run constantly (kpanel, kwm, kfm(?)). I could add 
a
> short dmalloc chapter to my "Hunting Memory Leaks" paper.

You are right, I have discovered and removed some memory leaks from 
kpanel (some fixes
are already in the CVS, others are on the way).

After some investigation with dmalloc (alloc_current), today I have 
patched ccmalloc to
enable/disable memory leaks tracking while the application is running.
This modified version of ccmalloc is very helpful for this purpose: 
normally,
ccmalloc reports all memory leaks (and the context in which the memory 
has been allocated)
when the application terminates. Turning on leaks tracking only for 
part of the execution
makes the job of interpreting logs much easier.

If other guys are interested, I can release the patch and add a short 
section to the
Harri's paper.

-- Pietro

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic