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

List:       kde-commits
Subject:    Re: qt-copy/src/kernel
From:       Simon Hausmann <hausmann () kde ! org>
Date:       2001-11-15 16:03:53
[Download RAW message or body]

On Thu, Nov 15, 2001 at 12:39:55PM +0100, Dirk Mueller wrote:
> On Don, 15 Nov 2001, Simon Hausmann wrote:
> 
> > Modified Files:
> >          qinputcontext_x11.cpp
> > Log Message:
> > - work around awful memleak in Xlib. approved by qt-bugs.
> 
> ah, is that the leak in XFree* allocating some memory which is never freed ?

That's the ktrace output:

   0x40b4afdd libc.so.6(malloc+0x2d)
   0x408c98ae libX11.so.6
   0x408c8e29 libX11.so.6(XLoadQueryFont+0x139)
   0x40939943 libX11.so.6
   0x40939999 libX11.so.6
   0x4093b321 libX11.so.6
   0x4093b73d libX11.so.6
   0x408f72b5 libX11.so.6(XCreateOC+0x55)
   0x408f67e5 libX11.so.6(XCreateFontSet+0x5d)
   0x403a601f libqt-mt.so.3(QInputContext::setXFontSet(QFont*)+0x27f)
   0x403bc676 libqt-mt.so.3(QWidget::setMicroFocusHint( [....]

It looks like XFreeFontSet indeed doesn't free the memory allocated
by XCreateFontSet. The workaround is quite safe tho :)

The problem was that this leak summed up _really_ quickly, as each
keypress in a qlineedit results in a setMicroFocusHint call which
resulted in a XFreeFontSet/XCreateFontSet pair -- that's why ksirc
quickly had >~100MB mem usage with active chatters ;-)

Simon

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

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