How to disable/limit pixmap cache in X
glynn at gclements.plus.com
Thu Sep 20 00:57:52 PDT 2007
Daniel Stone wrote:
> > 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.
> On systems with overcommit (i.e., all of them), there's no way to tell.
Even on systems without overcommit, there's no way to tell how much
memory you will need in the future for other clients (which is what I
mean by "headroom").
If the server simply allows allocation so long as it can satisfy that
particular allocation, you can end up allowing Firefox to consume 99%
of available memory, then having to refuse a 1KiB allocation from a
less "greedy" client.
It may be worth having "fair share" rules, limiting the amount of
memory which can be used e.g. by a single client, or for pixmaps, or
for pixmaps over a certain size, etc. IOW, push the consequences of
greedy clients onto the clients in question, rather than onto
whichever unlucky client makes an allocation at the wrong time.
The "turn every image into a pixmap then forget about it" approach is
fine for programs which are only using them for icons, stipple
patterns etc. Programs which are image-intensive need a genuine policy
for choosing between a Pixmap and an XImage.
Glynn Clements <glynn at gclements.plus.com>
More information about the xorg