This page is a list of things we know that happen, but we don't know why they happen. If you know about the internals of the kernel, or libc, please enlighten us
Contents
Does prelink actually reduce memory usage?
BenMaurer: This is a dump of rml's pmap from a hello world program. Most of the rw mappings seem to have about the same anon and rss. This seems to mean that .data items are geting relocated. But I have prelinked my system? Is this reasonable? What is going on?
MikeHearn: prelinking doesn't eliminate all relocations, binaries can still have conflicts. It can reduce memory usage by cutting the number of pages that have to be written to for each process, but it was designed primarily to speed up startup time.
[benm@omega procps-pmap-per-vma-rss]$ ps aux | grep a.out benm 18980 1.8 0.4 10592 4820 pts/4 S+ 23:20 0:00 ./a.out benm 18985 0.0 0.0 2604 648 pts/2 S+ 23:20 0:00 grep a.out [benm@omega procps-pmap-per-vma-rss]$ ./pmap 18980 18980: a.out Start Size RSS Anon Perm Mapping 08048000 4K 4K 0K r-xp /home/benm/a.out 08049000 4K 4K 4K rw-p /home/benm/a.out 0804a000 860K 168K 168K rw-p [ anon ] 41000000 88K 80K 0K r-xp /lib/ld-2.3.3.so 41016000 4K 4K 4K rw-p /lib/ld-2.3.3.so 41019000 1060K 472K 0K r-xp /lib/tls/libc.so.6 41122000 32K 16K 12K rw-p /lib/tls/libc.so.6 4112a000 12K 12K 12K rw-p [ anon ] 4112f000 8K 8K 0K r-xp /lib/libdl.so.2 41131000 4K 4K 4K rw-p /lib/libdl.so.2 41134000 132K 24K 0K r-xp /lib/tls/libm.so.6 41155000 4K 4K 4K rw-p /lib/tls/libm.so.6 41158000 992K 348K 0K r-xp /usr/X11R6/lib/libX11.so.6.2 41250000 16K 16K 16K rw-p /usr/X11R6/lib/libX11.so.6.2 41268000 56K 24K 0K r-xp /usr/X11R6/lib/libXext.so.6.4 41276000 4K 4K 4K rw-p /usr/X11R6/lib/libXext.so.6.4 412b1000 396K 216K 0K r-xp /usr/lib/libfreetype.so.6.3.5 41314000 28K 16K 16K rw-p /usr/lib/libfreetype.so.6.3.5 4131d000 112K 80K 0K r-xp /usr/lib/libexpat.so.0.5.0 41339000 12K 8K 4K rw-p /usr/lib/libexpat.so.0.5.0 4133e000 28K 28K 0K r-xp /usr/X11R6/lib/libXrender.so.1.2.2 41345000 4K 4K 4K rw-p /usr/X11R6/lib/libXrender.so.1.2.2 41348000 148K 116K 0K r-xp /usr/lib/libfontconfig.so.1.0.4 4136d000 16K 16K 4K rw-p /usr/lib/libfontconfig.so.1.0.4 41371000 4K 4K 4K rw-p [ anon ] 41374000 72K 60K 0K r-xp /usr/X11R6/lib/libXft.so.2.1.1 41386000 4K 4K 4K rw-p /usr/X11R6/lib/libXft.so.2.1.1 41389000 28K 24K 0K r-xp /usr/X11R6/lib/libXi.so.6.0 41390000 4K 4K 4K rw-p /usr/X11R6/lib/libXi.so.6.0 41393000 12K 8K 0K r-xp /usr/X11R6/lib/libXrandr.so.2.0 41396000 4K 4K 4K rw-p /usr/X11R6/lib/libXrandr.so.2.0 41399000 504K 280K 0K r-xp /opt/gnome/lib/libglib-2.0.so.0.400.6 41417000 4K 4K 4K rw-p /opt/gnome/lib/libglib-2.0.so.0.400.6 41418000 4K 4K 4K rw-p [ anon ] 4150d000 224K 224K 0K r-xp /opt/gnome/lib/libgobject-2.0.so.0.400.6 41545000 8K 8K 8K rw-p /opt/gnome/lib/libgobject-2.0.so.0.400.6 41549000 12K 12K 0K r-xp /opt/gnome/lib/libgmodule-2.0.so.0.400.6 4154c000 4K 4K 4K rw-p /opt/gnome/lib/libgmodule-2.0.so.0.400.6 4154f000 92K 20K 0K r-xp /opt/gnome/lib/libgdk_pixbuf-2.0.so.0.400.14 41566000 4K 4K 4K rw-p /opt/gnome/lib/libgdk_pixbuf-2.0.so.0.400.14 415b9000 188K 164K 0K r-xp /opt/gnome/lib/libpango-1.0.so.0.400.1 415e8000 20K 20K 8K rw-p /opt/gnome/lib/libpango-1.0.so.0.400.1 415ef000 144K 44K 0K r-xp /opt/gnome/lib/libpangoft2-1.0.so.0.400.1 41613000 4K 4K 4K rw-p /opt/gnome/lib/libpangoft2-1.0.so.0.400.1 41616000 44K 20K 0K r-xp /opt/gnome/lib/libpangox-1.0.so.0.400.1 41621000 4K 4K 4K rw-p /opt/gnome/lib/libpangox-1.0.so.0.400.1 41624000 16K 16K 0K r-xp /opt/gnome/lib/libpangoxft-1.0.so.0.400.1 41628000 4K 4K 4K rw-p /opt/gnome/lib/libpangoxft-1.0.so.0.400.1 4162b000 3064K 760K 0K r-xp /opt/gnome/lib/libgtk-x11-2.0.so.0.400.14 41929000 36K 36K 24K rw-p /opt/gnome/lib/libgtk-x11-2.0.so.0.400.14 41932000 12K 8K 8K rw-p [ anon ] 41937000 476K 384K 0K r-xp /opt/gnome/lib/libgdk-x11-2.0.so.0.400.14 419ae000 20K 20K 12K rw-p /opt/gnome/lib/libgdk-x11-2.0.so.0.400.14 419b5000 100K 40K 0K r-xp /opt/gnome/lib/libatk-1.0.so.0.600.0 419ce000 8K 4K 4K rw-p /opt/gnome/lib/libatk-1.0.so.0.600.0 b7ea1000 140K 72K 0K r--p /usr/X11R6/lib/X11/fonts/truetype/verdana.ttf b7ec4000 8K 8K 0K r-xp /opt/gnome/lib/pango/1.4.0/modules/pango-basic-fc.so b7ec6000 4K 4K 4K rw-p /opt/gnome/lib/pango/1.4.0/modules/pango-basic-fc.so b7ec7000 44K 36K 0K r-xp /opt/gnome/lib/gtk-2.0/engines/libindustrial.so b7ed2000 4K 4K 4K rw-p /opt/gnome/lib/gtk-2.0/engines/libindustrial.so b7ed3000 4K 4K 0K r-xp /usr/lib/gconv/ISO8859-1.so b7ed4000 4K 4K 4K rw-p /usr/lib/gconv/ISO8859-1.so b7ed5000 4K 4K 0K r-xp /usr/X11R6/lib/X11/locale/lib/common/xlcUTF8Load.so.2 b7ed6000 4K 4K 4K rw-p /usr/X11R6/lib/X11/locale/lib/common/xlcUTF8Load.so.2 b7ed7000 204K 20K 0K r--p /usr/lib/locale/en_US.utf8/LC_CTYPE b7f0a000 4K 4K 0K r--p /usr/lib/locale/en_US.utf8/LC_NUMERIC b7f0b000 4K 4K 0K r--p /usr/lib/locale/en_US.utf8/LC_TIME b7f0c000 864K 12K 0K r--p /usr/lib/locale/en_US.utf8/LC_COLLATE b7fe4000 20K 20K 20K rw-p [ anon ] b7ff1000 4K 4K 0K r--p /usr/lib/locale/en_US.utf8/LC_MONETARY b7ff2000 4K 4K 0K r--p /usr/lib/locale/en_US.utf8/LC_MESSAGES/SYS_LC_MESSAGES b7ff3000 4K 4K 0K r--p /usr/lib/locale/en_US.utf8/LC_PAPER b7ff4000 4K 4K 0K r--p /usr/lib/locale/en_US.utf8/LC_NAME b7ff5000 4K 4K 0K r--p /usr/lib/locale/en_US.utf8/LC_ADDRESS b7ff6000 4K 4K 0K r--p /usr/lib/locale/en_US.utf8/LC_TELEPHONE b7ff7000 4K 4K 0K r--p /usr/lib/locale/en_US.utf8/LC_MEASUREMENT b7ff8000 24K 24K 0K r--s /usr/lib/gconv/gconv-modules.cache b7ffe000 4K 4K 0K r--p /usr/lib/locale/en_US.utf8/LC_IDENTIFICATION b7fff000 4K 4K 4K rw-p [ anon ] bffee000 64K 48K 52K rwxp [ stack ] bfffe000 8K 4K 8K rw-p [ anon ] ffffe000 4K 0K 0K ---p [ anon ] mapped: 10596K writeable/private: 1260K shared: 24K
English (aka "no .mo files used") vs. another language
$ LANG=en_US.UTF-8 gedit & [1] 529 $ ps auxw | grep gedit federico 529 0.0 2.5 22260 13128 pts/1 S Jan22 0:00 gedit ^^^^^ ^^^^^ $ LANG=es_mx.UTF-8 gedit & [1] 546 $ ps auxww | grep gedit federico 546 0.0 2.6 22020 13548 pts/1 S Jan22 0:00 gedit ^^^^^ ^^^^^
Why is the VM size of the English version larger? And why is the RSS of the Spanish version that much larger, even when .mo files are mmap()ed?
There are more detailed results here:
Answers:
BenMaurer: I used rml's kernel hack:
[benm@omega procps-pmap-per-vma-rss]$ ps -C gedit PID TTY TIME CMD 11865 pts/4 00:00:00 gedit [benm@omega procps-pmap-per-vma-rss]$ ./pmap 11865 | grep LC_CO b7deb000 864K 12K 0K r--p /usr/lib/locale/en_US.utf8/LC_COLLATE
So, only 12 kb of this is actually being read. As for the .mo files, I've no idea.