flush xorg image cache?

Alan Cox alan at lxorguk.ukuu.org.uk
Wed Apr 20 09:33:52 PDT 2005


On Mer, 2005-04-20 at 17:59, Roland Mainz wrote:
> heap size - and due the implementation of most default memory allocators
> in unix/linux the heap size cannot shrink[1].

ITYM "In unix"

To quote the glibc manual on "Efficiency Considerations for 'malloc'"

--
   Very large blocks (much larger than a page) are allocated with
`mmap' (anonymous or via `/dev/zero') by this implementation.  This has
the great advantage that these chunks are returned to the system
immediately when they are freed.  Therefore, it cannot happen that a
large chunk becomes "locked" in between smaller ones and even after
calling `free' wastes memory.  The size threshold for `mmap' to be used
can be adjusted with `mallopt'.  The use of `mmap' can also be disabled
completely.
--

So for the Linux case mallopt should be all you need to touch.


Alan




More information about the xorg mailing list