starting other programs from within python

Peter Hansen peter at engcorp.com
Tue Jul 16 18:13:52 EDT 2002


hejduk wrote:
> 
> However, when I monitor the memory usage of the interpreter it appears
> that when this outside application is closed that not all the memory resource is
> returned, ie:
> 
> before: 7248 k
> during: 18624 k
> after:  12284 k

Analysing memory usage like this with a single run is never a good
idea.  Run it multiple times (start, exit, start, exit) and monitor
the usage.  You may find that it "settles out" after two times and
does not, in fact, leak resources.  You may also find it climbs and
falls in a cycle, which is one of several possible effects you might
see, since the operating system is probably doing an awful lot of
sophisticated stuff you aren't even noticing.

In any event, you didn't mention a number of important facts, like
what operating system you are using, how you are monitoring memory
usage, what version of Python you have, and so on.  Without that
it may be difficult to draw any useful conclusions.

-Peter



More information about the Python-list mailing list