applets + pixmaps

james, glynn: the situation with some applets is actually a (little bit) bad in terms of pixmap memory use

battstat as an example: in initialise_global_pixmaps, i call gdk_pixmap_create_from_xpm_d a bunch of times to store every pixmap we’ll ever need inside of the x server (on battery, on ac, charging, etc…). this takes up a bunch of pixmap memory but also means that it’s not taking up process memory. the pixmaps are stored only once even if you have many instances (not too often you have more than one battery status applet, though…).

“not taking up process memory” is a tricky one here, though, since all of the pixmaps are stored in text xpm format which is statically linked into the battstat binary. this xpm text is 8470 bytes plus the overhead of maintaining an array of the lines. over all i imagine about 10k is wasted on data that is used on startup then never again.

on the plus side, it can swap out and never needs to come back.

i’m not going to fix this since the entire way we handle this is planned to change soon (ie: svg instead of xpm). let’s see what memory usage is like then…..

One Comment

  1. Posted December 9, 2005 at 8:59 pm | Permalink

    Ryan: I think Glynn was referring to the fact that all the applets seemed to each be using ~ 400k of pixmap memory. This does not seem to be related to particular applets doing particular stupid things. If that wasn’t the issue Glynn was pointing at, he’ll need to be a bit more specific.

    My tests seemed to show that this isn’t an issue unique to those applets, since the simple Python program I showed exhibited the same behaviour.