[cairo] [Patch] Limit the amount of shared memory that cairo-xcb uses

Uli Schlachter psychon at znc.in
Sun Jan 30 09:21:06 PST 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi,

today I was toying around with cairo-perf-trace. I made cairo-xlib and cairo-xcb
not use the RENDER extension and wanted to see if there are any interesting
performance differences with cairo-perf-trace (there aren't).

However, at first cairo-xcb ran into some CAIRO_STATUS_NO_MEMORY problems. It
was uploading the rendered results via SHM, but didn't manage to free any of
those allocations again. It managed to use 1.5 GiB of SHM before finally an
allocation failed.

The attached patches make cairo limit itself to 16 MiB of shared memory per
cairo_xcb_connection_t. The first patch implements the limit, then comes some
cleanup and finally callers are modified to retry without SHM when SHM fails.

16 MiB is a pretty arbitrary pick. If someone has any ideas why this would be
too low / too high, feel free to mention them.

If no one complains, I'll push this to master.

Cheers,
Uli
- -- 
"Do you know that books smell like nutmeg or some spice from a foreign land?"
                                                  -- Faber in Fahrenheit 451
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEcBAEBCAAGBQJNRZ3+AAoJECLkKOvLj8sGZZoH/3u2N8fCQ7xkVaYnmB8VNe92
rupPX0vL+PNoRRLWxEiohaRMGROls73ALpncTSMreUVkc71DCAsPjuavHDK9Ds2c
Qff3oOqzCm6Qm3ygE/NuDeiwbh12aVX11OS08sTTdhazSZYIazynIJlpGsVgNBLV
XL+lQXfDscKyEBzOygO4ESlMwykHg7SWStIWfS3tqfQX4MWG9+aQEj638zOU+4D1
uCOISNp05philGofm8WiAXO3fpRU2W/fwIJtzBDdbilJAtSGfZJ28vqkWoFBaOP8
zNhIwciAB2D/quBkglPdNO2yN0mISkDZTBTQPMHRi96NU9tHRDW9rIEpStbTT1w=
=fkMq
-----END PGP SIGNATURE-----


More information about the cairo mailing list