How to disable/limit pixmap cache in X
Glynn Clements
glynn at gclements.plus.com
Wed Sep 19 00:40:46 PDT 2007
Jim Kronebusch wrote:
> I have spent the better part of the last 2 weeks trying to figure out what has been
> plaguing my thin client network (and many others all over the world). It turns out that
> there is a feature in X used by many applications that allow them to cache image files
> to X in the form of pixmaps. This appears to be a good thing for standard Desktop
> systems as it improves performance for many apps when dealing with images. However this
> is a massive problem for Linux thin clients that appears to have been getting
> increasingly worse over the last few years. Typical thin clients do not have local swap
> space, and usually run low amounts of RAM (128MB or so). Applications such as Firefox
> and OpenOffice are very quick to start sucking up the RAM to use as an area to store
> pixmaps. Simple OpenOffice documents (especially when printing to low memory printers)
> or websites with many images can quickly chew up all available system RAM on a thin
> client starving necessary applications from the RAM they need and causing a complete
> system freeze requiring a hard reboot.
>
> It appears that the ability to cache pixmaps to RAM is not a necessity and rather a
> feature to help speed up image access. So I joined this list to see if anyone knows of
> a way to say limit in X the amount of pixmap storage available to applications, or how
> to even prevent them from caching pixmaps at all.
>
> In the world of thin clients this is an extremely large problem in desperate need of
> resolution. Pixmap caching seems to be the most significant problem causing instability
> in Linux thin client technology. Consider this my desperate cry for help.
>
> If such a feature is not available at this time, if someone could let me know if this is
> even a feasible possibility that would be great. Again a feature to only limit pixmap
> cache space or to disable it completely is needed. Limiting an applications memory
> usage as a whole causes the applications to fail when exceeded. This is not a request
> for regulating system memory as a whole, just the caching of pixmaps.
>
> Any thoughts or suggestions on this would be very appreciated by the entire Linux thin
> client community (LTSP, Edubuntu, SkoleLinux, MilleXTerm, etc).
The server doesn't "cache" pixmaps, it stores them.
[The server may cache some of those pixmaps in video RAM, with the
rest stored in the server's memory, but this isn't visible to the
client.]
A "cache" duplicates information which is available elsewhere in order
to improve performance. The term implies that the cached data can be
discarded at will, with the only consequence being increased "cost" if
the data is required later.
A pixmap is an image which is stored by the server. If a client tells
the server to create a pixmap, failure to do so is likely to be
considered a "fatal" error by the client. Once the server has created
a pixmap, it is required to store it until the client explicitly tells
the server to free it.
If an application makes "excessive" use of pixmaps, this has to be
dealt with in the client.
With regard to the statement:
> It appears that the ability to cache pixmaps to RAM is not a necessity and rather a
> feature to help speed up image access.
Yes and no.
The client could store the image itself (as an XImage), and send the
image data to the server whenever it wants the image to be drawn.
However, this is the client's decision; if the client decides to store
the image in the server (as a pixmap), the server doesn't really have
much choice in the matter.
IOW, this issue really needs to be taken up with the application
and/or toolkit developers.
--
Glynn Clements <glynn at gclements.plus.com>
More information about the xorg
mailing list