Why does gnome-panel use 290MB?
I noticed, on my 64-bit Linux system, that gnome-panel was apparently using an awful lot of virtual memory.
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 3734 rjk 20 0 290m 16m 6668 S 0 0.8 3:22.05 gnome-panel
Virtual memory’s pretty cheap, so that’s not hugely problematic, but it seemed a huge amount for a glorified toolbar. I looked in /proc/3734/maps and found that about 260MB of that space belonged to shared libraries. Now, gnome-panel does use a lot of library, 82 to be precise, but 3MB per library sounded a lot, and the biggest of them is only 4MB. Looking closer I noticed that an awful lot of the libraries had 2MB (0x200000) non-executable mappings associated with them. As an example here are the mappings for GTK+ (with the size in hex added at the start for convenience):
3c7000 7f967efd6000-7f967f39d000 r-xp 00000000 fe:00 3111259 /usr/lib/libgtk-x11-2.0.so.0.1200.12 200000 7f967f39d000-7f967f59d000 ---p 003c7000 fe:00 3111259 /usr/lib/libgtk-x11-2.0.so.0.1200.12 a000 7f967f59d000-7f967f5a7000 rw-p 003c7000 fe:00 3111259 /usr/lib/libgtk-x11-2.0.so.0.1200.12
The first line is the code segment and the last the data segment. But what’s the strange 0x200000 (2MB) mapping in the middle?