flush xorg image cache?

Roland Mainz roland.mainz at nrubsig.org
Wed Apr 20 09:59:01 PDT 2005


Christian Hoenig wrote:
> I'm working on an image viewer written in Qt. Now having alot of large scale
> images boosts xorgs memory footprint pretty much. As X caches the images,
> this is not a problem if it wouldn't be persistent after my program quits.
> 
> Is there a way to ask xorg to flush its image cache? I thought, I heard of
> one, but I really cannot remember.

AFAIK the Xservers do not have an "image cache". What you may be seeing
is the allocation of giant pixmaps in the Xserver code which grow the
heap size - and due the implementation of most default memory allocators
in unix/linux the heap size cannot shrink[1].
BTW: For the pixmap problem I am working right now on a solution which
should enable the Xserver to release memory of large pixmaps (like
Solaris/Xsun already does) - that's
https://bugs.freedesktop.org/show_bug.cgi?id=3053 ("RFE: Need API
(|MapAlloc()|/|MapFree()|) to allocate large memory chunks via
|mmap()|").

[1]=On Solaris you can use an alternative memory allocator such as
mapmalloc(3malloc), however the Solaris/Xsun Xserver already obtains
memory for large pixmaps via |mmap()| so this is not neccesary.

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz at nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 7950090
 (;O/ \/ \O;)



More information about the xorg mailing list