[XML-SIG] Re: Memory leak in xmlrpclib.py on Windows?

Mark Moales mmoales@fluent.com
Thu, 22 Aug 2002 10:45:32 -0400


This is a multi-part message in MIME format.
--------------397CDC7289865CA945976578
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

The problem appears to be in httplib.HTTPConnection.  I replaced
xmlrpclib.Transport with my own socket-based Transport and the memory
leak goes away.  So, I took the HTTPConnection sample out of the Python
doc and stuck a loop around it.  Sure enough, I see a 4K increase every
10 seconds or so over the life of the process.

Thanks,

Mark

Mark Moales wrote:
> 
> Hi,
> 
> If this isn't the correct mailing list to send this type of question to,
> please forgive me...
> 
> I'm running a very simple XML-RPC client/server on Windows 2000 using
> Python 2.2.1.  Using perfmon, I see about a 4K increase in the size of
> my client and server processes after about a half dozen or so calls.  It
> doesn't seem to matter which parser I use (expat or SlowParser).  I get
> similar results.  I also ran my test on a Linux box without expat and
> did NOT see the leak.  Any ideas?  I seem to remember seeing something
> about a leak in the expat parser, but, like I said, I see similar
> results using the SlowParser.  I've attached my scripts if anyone would
> like to try it.
> 
> Thanks!
> 
> Mark Moales
> 
>   ------------------------------------------------------------------------
> from SimpleXMLRPCServer import *
> 
> class SimpleServer:
>     def processData(self):
>         print 'SimpleServer invoked'
>         return 1
> 
> if __name__ == '__main__':
>     server = SimpleXMLRPCServer(('localhost', 80))
>     server.register_instance(SimpleServer())
>     server.serve_forever()
> 
>   ------------------------------------------------------------------------
> from xmlrpclib import ServerProxy
> import gc
> import time
> 
> def runit():
>     sp = ServerProxy('http://localhost')
> 
>     for i in range(600):
>         result = sp.processData()
>         time.sleep(0.5)
> 
> if __name__ == '__main__':
>     runit()
--------------397CDC7289865CA945976578
Content-Type: text/x-vcard; charset=us-ascii;
 name="mmoales.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Mark Moales
Content-Disposition: attachment;
 filename="mmoales.vcf"

begin:vcard 
n:Moales;Mark
tel;work:603-643-2600 x758
x-mozilla-html:FALSE
url:www.fluent.com
org:Fluent, Inc.;Software Development
version:2.1
email;internet:mmoales@fluent.com
adr;quoted-printable:;;10 Cavendish Ct.=0D=0A;Lebanon;NH;03766;USA
fn:Mark Moales
end:vcard

--------------397CDC7289865CA945976578--