How to disable/limit pixmap cache in X

Glynn Clements glynn at gclements.plus.com
Wed Sep 19 12:50:20 PDT 2007


Gavin McCullagh wrote:

> > > 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.
> 
> Is this fundamental to how X servers and clients interact?  Is it really
> not feasible for the server to refuse, in order to preserve itself and the
> other running applications?

Yes, the server can refuse to create the pixmap, sacrificing the
client to protect the server and other clients.

It just needs to be borne in mind that this will probably be fatal to
the client.

I had assumed that Jim was under the impression that the server was
merely "caching" this data as an optimisation, and that reducing the
amount of memory used would merely degrade performance. That isn't the
case.

It appears that Jim is willing to sacrifice the client for the sake of
the whole. In that regard, the server should probably be making a bit
more effort to better handle out-of-memory situations. Unfortunately,
that's easier said than done, as it can't reliably tell how much
"headroom" it's going to need.

-- 
Glynn Clements <glynn at gclements.plus.com>



More information about the xorg mailing list