Just something odd I noticed while reviewing the SGE job success emails for MIMEStatBot: When the script runs on a Solaris host, the "Max vmem" value is consistently between 20 and 25 M, but on Linux it jumps up to over 160 M.
Furthermore, the same effect can be reproduced with a much simpler test script. Compare:
vyznev@willow:~$ perl -e 'system "uname -a; ps -o comm,vsz -p $$"' SunOS willow 5.10 Generic_147441-19 i86pc i386 i86pc Solaris COMMAND VSZ perl 6632
vyznev@nightshade:~$ perl -e 'system "uname -a; ps -o comm,vsz -p $$"' Linux nightshade 2.6.32-5-amd64 #1 SMP Sun May 6 04:00:17 UTC 2012 x86_64 GNU/Linux COMMAND VSZ perl 104364
What's going on here? It it just an accounting difference, or does a Perl process on Linux really consume over 100 megabytes more memory than on Solaris?
On Sun, Sep 02, 2012 at 07:24:40PM +0300, Ilmari Karonen wrote:
vyznev@willow:~$ perl -e 'system "uname -a; ps -o comm,vsz -p $$"' SunOS willow 5.10 Generic_147441-19 i86pc i386 i86pc Solaris COMMAND VSZ perl 6632
vyznev@nightshade:~$ perl -e 'system "uname -a; ps -o comm,vsz -p $$"' Linux nightshade 2.6.32-5-amd64 #1 SMP Sun May 6 04:00:17 UTC 2012 x86_64 GNU/Linux COMMAND VSZ perl 104364
What's going on here? It it just an accounting difference, or does a Perl process on Linux really consume over 100 megabytes more memory than on Solaris?
Not usually.
ralf@ark ~ $ perl -e 'system "uname -a; ps -o comm,vsz -p $$"' Linux ark 3.2.1-gentoo-r2 #21 SMP Tue Jul 17 11:00:26 CEST 2012 x86_64 AMD Phenom(tm) II X6 1055T Processor AuthenticAMD GNU/Linux COMMAND VSZ perl 16740
Just FYI.
ralf
To begin with, the perl used in Solaris is 32 bit and the Linux one 64 bit. They are also different versions (v5.12.3 vs v5.10.1).
But the main difference is probably in the linux version mapping /usr/lib/locale/locale-archive, a 86M file, while in Solaris it seems to be using /usr/lib/locale/en_US.UTF-8/en_US.UTF-8.so.3, /usr/lib/locale/en_US.UTF-8/en_US.UTF-8.so.3 and /usr/lib/locale/en_US.UTF-8/libc.so.1 instead.
From locale-gen(8): Locale data files can be stored either in a single archive file, /usr/lib/locale/locale-archive, or in a deep tree where individual files are stored under /usr/lib/locale/<locale_name>/LC_*.
As all processes will be sharing the same locale-archive file, the two methods shouldn't matter too much for memory usage, although locale-archive will probably bite us when dumping core.
Hello, At Sunday 02 September 2012 22:12:28 DaB. wrote:
What's going on here? It it just an accounting difference, or does a Perl process on Linux really consume over 100 megabytes more memory than on Solaris?
it is hard to compare the memory-usage between linux and solaris, because both handle vmsize different. For linux it is the reserved memory plus the heap plus the shared libraries; that's the reason linux tells you that a simple bash- shell needs >100MB of RAM. For Solaris it is just the used space (and maybe the heap); so bash "needs" only 7MB here. If you like to know how many memory your task is "using" at the moment, RSS is a far better place to look (you have to subtract the shared libraries through). For details about the linux-memory-system see [1].
Sincerely, DaB.
[1] http://bmaurer.blogspot.de/2006/03/memory-usage-with-smaps.html
toolserver-l@lists.wikimedia.org