[Python-bugs-list] [Bug #127699] Memory leaks using imp.load_module

noreply@sourceforge.net noreply@sourceforge.net
Fri, 05 Jan 2001 12:30:57 -0800


Bug #127699, was updated on 2001-Jan-05 12:30
Here is a current snapshot of the bug.

Project: Python
Category: Python Interpreter Core
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Submitted by: cgw
Assigned to : nobody
Summary: Memory leaks using imp.load_module

Details: #!/usr/bin/env python

import os
import sys
import imp

print os.getpid()

sys.path.append("/tmp")

count = 0

while (count<1000):
    modname = "testmod%s" % count
    count = count + 1

    filename = '/tmp/'  + modname + '.py'
    f  = open(filename, 'w')
    for x in range(10000):
        f.write('x%s=%s\n'%(x,x))
    f.close()
    
    modinfo = imp.find_module(modname)
    print 'loading', modname
    m = apply(imp.load_module, ('testmod',) + modinfo)
    
## run "watch -n 1 ps up <pid>
## where <pid> is the pid printed out by this program
    


For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=127699&group_id=5470