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 :)

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/
41016000        4K        4K        4K rw-p /lib/
41019000     1060K      472K        0K r-xp /lib/tls/
41122000       32K       16K       12K rw-p /lib/tls/
4112a000       12K       12K       12K rw-p [ anon ]
4112f000        8K        8K        0K r-xp /lib/
41131000        4K        4K        4K rw-p /lib/
41134000      132K       24K        0K r-xp /lib/tls/
41155000        4K        4K        4K rw-p /lib/tls/
41158000      992K      348K        0K r-xp /usr/X11R6/lib/
41250000       16K       16K       16K rw-p /usr/X11R6/lib/
41268000       56K       24K        0K r-xp /usr/X11R6/lib/
41276000        4K        4K        4K rw-p /usr/X11R6/lib/
412b1000      396K      216K        0K r-xp /usr/lib/
41314000       28K       16K       16K rw-p /usr/lib/
4131d000      112K       80K        0K r-xp /usr/lib/
41339000       12K        8K        4K rw-p /usr/lib/
4133e000       28K       28K        0K r-xp /usr/X11R6/lib/
41345000        4K        4K        4K rw-p /usr/X11R6/lib/
41348000      148K      116K        0K r-xp /usr/lib/
4136d000       16K       16K        4K rw-p /usr/lib/
41371000        4K        4K        4K rw-p [ anon ]
41374000       72K       60K        0K r-xp /usr/X11R6/lib/
41386000        4K        4K        4K rw-p /usr/X11R6/lib/
41389000       28K       24K        0K r-xp /usr/X11R6/lib/
41390000        4K        4K        4K rw-p /usr/X11R6/lib/
41393000       12K        8K        0K r-xp /usr/X11R6/lib/
41396000        4K        4K        4K rw-p /usr/X11R6/lib/
41399000      504K      280K        0K r-xp /opt/gnome/lib/
41417000        4K        4K        4K rw-p /opt/gnome/lib/
41418000        4K        4K        4K rw-p [ anon ]
4150d000      224K      224K        0K r-xp /opt/gnome/lib/
41545000        8K        8K        8K rw-p /opt/gnome/lib/
41549000       12K       12K        0K r-xp /opt/gnome/lib/
4154c000        4K        4K        4K rw-p /opt/gnome/lib/
4154f000       92K       20K        0K r-xp /opt/gnome/lib/
41566000        4K        4K        4K rw-p /opt/gnome/lib/
415b9000      188K      164K        0K r-xp /opt/gnome/lib/
415e8000       20K       20K        8K rw-p /opt/gnome/lib/
415ef000      144K       44K        0K r-xp /opt/gnome/lib/
41613000        4K        4K        4K rw-p /opt/gnome/lib/
41616000       44K       20K        0K r-xp /opt/gnome/lib/
41621000        4K        4K        4K rw-p /opt/gnome/lib/
41624000       16K       16K        0K r-xp /opt/gnome/lib/
41628000        4K        4K        4K rw-p /opt/gnome/lib/
4162b000     3064K      760K        0K r-xp /opt/gnome/lib/
41929000       36K       36K       24K rw-p /opt/gnome/lib/
41932000       12K        8K        8K rw-p [ anon ]
41937000      476K      384K        0K r-xp /opt/gnome/lib/
419ae000       20K       20K       12K rw-p /opt/gnome/lib/
419b5000      100K       40K        0K r-xp /opt/gnome/lib/
419ce000        8K        4K        4K rw-p /opt/gnome/lib/
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/
b7ec6000        4K        4K        4K rw-p /opt/gnome/lib/pango/1.4.0/modules/
b7ec7000       44K       36K        0K r-xp /opt/gnome/lib/gtk-2.0/engines/
b7ed2000        4K        4K        4K rw-p /opt/gnome/lib/gtk-2.0/engines/
b7ed3000        4K        4K        0K r-xp /usr/lib/gconv/
b7ed4000        4K        4K        4K rw-p /usr/lib/gconv/
b7ed5000        4K        4K        0K r-xp /usr/X11R6/lib/X11/locale/lib/common/
b7ed6000        4K        4K        4K rw-p /usr/X11R6/lib/X11/locale/lib/common/
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:


  • 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.

Initiatives/MemoryReduction/HackerHelpNeeded (last edited 2013-11-22 21:16:21 by WilliamJonMcCann)