QMovie leaking lots of pixmap resources

Matthias Ettrich ettrich at trolltech.com
Thu Jan 1 20:05:30 GMT 2004

On Thursday 01 January 2004 19:39, Martijn Klingens wrote:
> On Thursday 01 January 2004 19:06, Dirk Mueller wrote:
> > they might be a trigger but not the cause. the pixmapcache size is
> > limited to 1MB in total, so it can't leak, even though you found an
> > inefficiency here (I agree the if should be changed to timer >= 0 && loop
> > >= 0).
> The cache doesn't seem to work properly though (at least on Qt 3.2) - the
> pixmap memory as reported by xrestop grows well above 2 Mb (it stops at
> 2342kb here). If I explicitly call setCacheLimit( 512 ) to use a half Mb
> cache the pixmap memory used by Kopete still grows till 1451 kb until it
> stops leaking. When I close the chat window the pixmap memory drops back to
> 147 kb. A new chat window eats some more, directly after opening one
> there's about 500 kb in use. In other words, a 512 kb pixmap cache actually
> eats a lot more, over a megabyte, and that's assuming all other pixmaps
> that xrestop reports are 'uncached'.

Quoting the doumentation:

    The cache becomes full when the total size of all pixmaps in the
    cache exceeds cacheLimit(). The initial cache limit is 1024 KByte
    (1 MByte); it is changed with setCacheLimit(). A pixmap takes
    roughly width*height*depth/8 bytes of memory.

The forumula width*height*depth/8 bytes (also used in the code) is not 
accurate, it ignores e.g. any mask or the alpha channel.


More information about the kde-core-devel mailing list