Message6123
(First, I made the same change to not use port 0, since it didn't work on OS X. It's irrelevant to the memory leak regardless.)
SocketServer.py is directly pulled in from CPython. It's clear there's a programming flaw here that has been fixed in subsequent versions of CPython, when comparing 2.5 vs 2.7. So we should have this pattern of try-finally:
class BaseRequestHandler:
def __init__(self, request, client_address, server):
self.request = request
self.client_address = client_address
self.server = server
self.setup()
try:
self.handle()
finally:
self.finish()
In 2.5, this is confused, so we have:
def __init__(self, request, client_address, server):
self.request = request
self.client_address = client_address
self.server = server
try:
self.setup()
self.handle()
self.finish()
finally:
sys.exc_traceback = None # Help garbage collection
In general that last bit would be unnecessary in Jython, although it wouldn't hurt either.
However, it still seems like we have slow upwards trend in memory consumption. So we may have similar leaks occurring elsewhere in the socket support. More analysis needed! |
|
Date |
User |
Action |
Args |
2010-10-03 16:31:45 | zyasoft | set | messageid: <1286123505.27.0.534659402621.issue1660@psf.upfronthosting.co.za> |
2010-10-03 16:31:45 | zyasoft | set | recipients:
+ zyasoft, amak, gdoutch |
2010-10-03 16:31:45 | zyasoft | link | issue1660 messages |
2010-10-03 16:31:43 | zyasoft | create | |
|