multiprocessing / forking memory usage

Aahz aahz at
Sat May 30 23:22:57 CEST 2009

In article <mailman.771.1243360355.8015.python-list at>,
Randall Smith  <randall at> wrote:
>I'm trying to get a grasp on how memory usage is affected when forking 
>as the multiprocessing module does.  I've got a program with a parent 
>process using wx and other memory intensive modules. It spawns child 
>processes (by forking) that should be very lean (no wx required, etc). 
>Based on inspection using "ps v" and psutil, the memory usage (rss) is 
>much higher than I would expect for the subprocess.

One option if you're concerned about memory usage is to os.exec() another
program after forking, which will overlay the current process.
Aahz (aahz at           <*>

    on-a-new-machine-ly y'rs  - tim

More information about the Python-list mailing list