[mod_python] high memory consumption with multiple Python interpreters ?

Richard Lewis richardlewis at fastmail.co.uk
Thu Nov 16 08:05:15 EST 2006


On Thursday 16 November 2006 12:47, Julien Cigar wrote:
> (how "heavy" is a Python interpreter ?) ?
>
Assuming you're on Unix, I would suggest that you try it out. Try loading some 
python processing and importing the modules that you use. Then drop back into 
the shell and go:

repeat:
$ python -ic "import my_module" &
several times

$ ps aux | head -1
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
$ ps aux | grep python
r  7884  0.5  1.6  11964  8576 pts/4    T    13:00   0:00 python -ic import m
r  7885  0.4  1.6  11972  8576 pts/4    T    13:00   0:00 python -ic import m
r  7886  0.7  1.6  11964  8576 pts/4    T    13:00   0:00 python -ic import m
r  7887  0.5  1.6  11972  8580 pts/4    T    13:00   0:00 python -ic import m
r  7888  0.6  1.6  11964  8576 pts/4    T    13:00   0:00 python -ic import m
r  7889  0.5  1.6  11964  8576 pts/4    T    13:00   0:00 python -ic import m
r  7892  1.5  1.6  11964  8576 pts/4    T    13:00   0:00 python -ic import m
r  7894  0.0  0.1   1952   632 pts/4    S+   13:00   0:00 grep python

As you can see, my python processes are each using 1.6% of my computer's 512MB 
of RAM. Its not the most accurate test, but its quite fun ;-)

Cheers,
Richard
-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Richard Lewis
Sonic Arts Research Archive
http://www.sara.uea.ac.uk/
JID: ironchicken at jabber.earth.li
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


More information about the Mod_python mailing list