python memory usage

Peter Maas fpetermaas at netscape.net
Mon Feb 16 04:40:13 EST 2004


In a recent discussion somebody claimed that python executable has
a huge memory consumption compared to perl and tcl, about 18 MB.
I didn't believe that and checked on my machine (SusE 7.3, Linux
2.4, Perl 5.6.1, Python 2.3.2, Tcl 8.3), command
ps -o "cmd rss vsize", results in kBytes:

CMD               RSS   VSZ
perl              984  2760
python           2556  4188
tclsh8.3         1100  2316

But python (contrary to perl) starts an interactive interpreter which
doesn't matter when executing scripts. To get rid of it I created
a fifo (mknod xxx p) and started all programs with 'prog xxx'.
The result:

CMD               RSS   VSZ
perl              892  2736
python            544  2424
tclsh8.3         1100  2316

The fifo keeps Python in working memory but since the input isn't
a tty, the interactive interpreter isnt't started. Is this a
reasonable comparison or did I miss something?

Mit freundlichen Gruessen,

Peter Maas

-- 
-------------------------------------------------------------------
Peter Maas, M+R Infosysteme, D-52070 Aachen, Hubert-Wienen-Str. 24
Tel +49-241-93878-0 Fax +49-241-93878-20 eMail peter.maas at mplusr.de
-------------------------------------------------------------------



More information about the Python-list mailing list