starting other programs from within python

hejduk claxtonr at beer.com
Wed Jul 17 12:36:57 EDT 2002


In article <3D349AA0.1AE34452 at engcorp.com>, "Peter Hansen"
<peter at engcorp.com> wrote:

> 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

I'm using python 2.2, on slak linux using gnome, and i'm monitoring the
memory usage with gtop.

my main concern really is whether i'm starting the processes in the right
manner. would spawnv or something else be better? i'm new to threads so i don't know
whether they need to be stopped manually or whether they'll shut down
automatically.



More information about the Python-list mailing list