Hi everyone.
Yesterday at the Distro-Constructor meeting, I took an AI to look into
footprints of Java vs Python.
I wrote simple java and python programs which do the equivalent of
system("sleep 10")
in C. I then ran pmap -x on each to check their footprint. Results are
dramatically different:
Kbytes RSS Anon
Java: total Kb 105888 25392 13016
Python: total Kb 5464 4648 1056
This data shows that Java has ~25Mb resident in memory vs ~4.5 Mb for
Python. It shows that total mapped virtual space for Java (including
space for things inactive) are nearly 32 times that of Python.
Java version:
java version "1.6.0_01"
Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
Java HotSpot(TM) Server VM (build 1.6.0_01-b06, mixed mode)
Python version:
Python 2.4.4 (#1, Sep 24 2007, 07:56:50) [C] on sunos5
Being that the test program itself is very small, the memory here has to
be mostly for the interpreters themselves. Larger test programs would
mean more memory.
Being that I don't know how the Python nor the Java interpreters have
been written, I can't come to an obvious conclusion here, because it is
possible that Python allocates more memory on demand and Java allocates
is up front.
I ran this on my (SPARC) Sun-Blade 2500.
Thanks,
Jack