Searching for solution: Severe memory leak, HELP!
randall_young at hotmail.com
Sat Jan 18 15:18:26 CET 2003
I have a very large Python application squarely in my lap, that's
leaking almost 20mb of main memory an hour!
I spent most of last night looking through various postings, and not
surprisingly, I'm wondering if I have a "circular reference" at work.
Specifically, something happening with the heavy use of the "exec"
Here's a code snippet, can anyone see anything grievously wrong? I
understand that we may need to look at WHAT is being "exec'd", but I
thought this might be a place to start...
---- CODE BEGINS
#import the module, then execute the probe
where = 'import'
exec ("import %s" % probeInfo['ImportName'])
except Exception, e:
ret = "Import error on " + str(probeInfo['ImportName']) + " " +
self.ExceptOut(e, 'Exception importing Probe ID ' +
if (ret == None):
where = 'exec'
s = "ret = %s.%s (probeInfo)" % (probeInfo['ImportName'],
# ... much more yada-yada ...
---- CODE ENDS
As you can see there are "exec(s)" all over the place in the module,
one mistake would be magnified many times! I'm trying to understand if
I should be forcing a garbage collection or some other obvious thing?
Thanks in advance for the consideration of a reply.
More information about the Python-list