After coming back from the wild goose chase figuring out leaks reported in gdk_window_invalidate_maybe_recurse(), _gdk_windowing_window_queue_antiexpose() and g_closure_invoke() (due to some interesting test setup) I sat down and optimized the sapwood theme engine data structures a bit saving maybe 30k per process.
Our gtkrc files are huge, 6000+ lines and 500+ file references so only saving the absolute image filenames takes quite a bit of memory. For comparison the largest gtkrc I could find on my desktop was Grand Canyon which is 817 lines and has 80 file references.
The optimization was rather simple and straightforward, splitting the path to directory and basename components; the directory is always the same until you switch themes so it can be efficiently shared. Turning struct members into bitfields saved some more memory and didn’t even need changes to the code.