Memory Usage

Tim Peters tim.peters at
Mon Jan 24 11:13:01 EST 2005

[<rbt at>]
> Would a Python process consume more memory on a PC with lots of
> memory?
> For example, say I have the same Python script running on two WinXP
> computers that both have Python 2.4.0. One computer has 256 MB of Ram
> while the other has 2 GB of Ram. On the machine with less Ram, the
> process takes about 1 MB of Ram. On the machine with more Ram, it uses
> 9 MB of Ram.
> Is this normal and expected behavior?

[and later confirms he's looking at Mem Usage in Task Manager]

256MB is on the low end for an XP system, and will generally cause
lots of swap space (virtual memory residing on disk -- kinda) to get
used.  Mem Usage doesn't count swap space, just RAM currently in use. 
Under Task Manager it's better to look at the VM Size column, which
tells roughly how much virtual address space is assigned to the
process, and regardless of how it's currently split between RAM and
disk.  You may need to use View -> Select Columns to get this
statistic displayed.  If your process is in fact using a fixed amount
of address space, the VM Size column will stay steady but Mem Usage
may jump all over the place as time goes on.  In general, I would
expect VM Size to be about the same on your two boxes; I would not
expect Mem Usage to be the same.

More information about the Python-list mailing list