module imports and memory usage

From: Brad Tilley (bradtilley_at_gmail.com)
Date: 11/30/04


Date: Tue, 30 Nov 2004 10:02:27 -0500

When memory usage is a concern, is it better to do:

from X import Y

or

import X

Also, is there a way to load and unload modules as they are needed. I
have some scripts that sleep for extended periods during a while loop
and I need to be as memory friendly as possible. I can post a detailed
script that currently uses ~ 10MB of memory if anyone is interested.

Thanks,
Brad



Relevant Pages

  • Re: Load Python Scripts from Memory
    ... > script/module from memory. ... > am building for scripts to be downloaded from a web site and run ... > (these can be pre-compiled scripts). ... stuff in memory from a "resource file", ...
    (comp.lang.python)
  • Re: I am pretty sure this isnt a FP problem but maybe someone can
    ... You just may want to check the scripts as they ... I would have them track your memory usage along ... of an hacker attack and this is the latest response I ... depth knowledge of all the scripts used on your website. ...
    (microsoft.public.frontpage.client)
  • Re: matlab speed issues
    ... windows, then creating and reusing one figure window would probably help. ... Although I've used the same function twice, the same memory space can't be used - the memory gets repeatedly fragmented. ... Although I'm told that functions are faster than scripts, they also seem to create other problems wrt fragmentation. ...
    (comp.soft-sys.matlab)
  • Re: Resource Leak from XslCompiledTransform
    ... The memory leaks in XSLT with scripts are not yet fixed in .net 2.0. ... keep its memory consumption at a reasonable level. ... replace the old XslTransform class, which looks lightweight and easier to ...
    (microsoft.public.dotnet.xml)
  • Re: mod_perl 1.99 apache 2.0.48
    ... > I did not modify my perl scripts in order to use mod_perl, ... references leaks memory. ... All sorts of things you do in Perl that should not leak memory do anyway. ...
    (comp.lang.perl.misc)