Memory usage of an 'empty' python interpreter

sjdevnull at yahoo.com sjdevnull at yahoo.com
Wed Aug 16 04:19:56 EDT 2006


neokosmos at gmail.com wrote:
> I was wondering what the approximate amount of memory needed to load a
> Python interpreter (only, no objects, no scripts, no nothing else) in a
> Linux 2.6 environment.  According to ps, it appears to be 3312 bytes,
> which seems absurdly low to me.

Your spidey sense is working properly, 3312 bytes is absurdly low.

> Here is the output of ps -aux | grep python
>
> USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME
> COMMAND
> paul     17561  0.1  0.6  14616  3312 pts/2    S+   02:33   0:00 python
[SNIP]
> If I am reading this right, it says the Python interpreter itself is
> using 3312 bytes of memory, but has 14616 bytes of shared memory it can
> access (which, i assume, is mostly shared libraries).

Nope, ps output for those values is in kilobytes.  It's a bit over 3 MB
RSS, 14MB shared.

> Here's my ls -l /usr/bin/python2.4:
>
> -rwxr-xr-x 1 root root 5424 Jul 21 08:02 /usr/bin/python2.4

I'm not sure what's up here (maybe a shell script wrapper?) try "file
/usr/bin/python2.4" and "ls -alh /usr/bin/python2.4".




More information about the Python-list mailing list