[cairo] [Patch] Limit the amount of shared memory that cairo-xcb uses
psychon at znc.in
Sun Jan 30 09:21:06 PST 2011
-----BEGIN PGP SIGNED MESSAGE-----
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
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.
"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)
-----END PGP SIGNATURE-----
More information about the cairo