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

List:       kde-devel
Subject:    Re: Howto reduce X11 memory usage with several QCanvas /
From:       Lubos Lunak <l.lunak () suse ! cz>
Date:       2004-06-27 13:23:05
Message-ID: 200406271523.05270.l.lunak () suse ! cz
[Download RAW message or body]

Dne čt 24. června 2004 21:48 Achim Spangler napsal(a):
> Hi,
> I use umbrello and try to help extending and bugfixing it ( e.g. scaled
> print, SVG export, autosave, line width ).
[...]
> My problem is now, that the memory footprint of X11 ( i.e. the X-Server
> program ) and umbrello is raised to the following values:
> VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
> 98452  46m  28m S 56.7  9.3   0:43.84 umbrello
> 615m 337m  46m S  2.9 67.0   3:32.83 X
> ^^^^^^^^
> ( output of "top" )
>
> I tried already to create only one central QCanvasView and to set the
> connection of the displayed QCanvas to the currently selected diagram.
> But this doesn't help to reduce the X11 memory footprint.
>
> I tried also to use the function QCanvas::retune() to set the chunkSize to
> 64, as the average size of the items is around 40.
> But also without success.
>
> So I have the following questions:
> 1) What can cause this high memory usage of X11 ( the umbrello footprint
> would be acceptable )?

 QPixmap's are stored in the XServer. Every pixmap takes roughly 
width*height*depth/8 bytes of memory in the XServer.

>
> 2) What can be done to reduce the memory usage?
>     -> is there a possibility to tell X11/Qt to eliminate all
>          metadata, which is needed for clipping/display control ...
>         so that this metadata could be re-derived on show-event?

 If xrestop reports the memory is used by pixmaps, then it should be only the 
actual pixmaps (i.e. the pixels). So the solution should be only using less 
pixmaps or making them smaller. I don't know QCanvas though, so I'm afraid I 
can't help you more.

 I'd suggest you first check what exactly is causing the memory usage. You can 
e.g. put sleep() calls in suitable places when creating the diagrams and 
check that the memory is used really because of QCanvas. My very first 
thought actually was that you were leaking QPixmap's somewhere.

>
> 3) What is the difference ( mainly in respect of X11 )
>     of hide() / setVisible( false ) / raise()->other items for global
> QCanvas and all contained items?
>   ( QWidget properties shown, hidden, visible )

 If you mean memory usage, then my guess would be there's no real difference, 
but as I said I don't know QCanvas. With QWidget's there is none.

-- 
 Lubos Lunak
 KDE Developer
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

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

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