Opened 16 years ago

Closed 16 years ago

#1495 defect closed fixed (fixed)

Memory leak using minimal web server?

Reported by: chileverde Owned by: jknight
Priority: highest Milestone:
Component: web Keywords:
Cc: jknight, chileverde, itamarst Branch:
Author:

Description


Attachments (1)

code.tar.gz (517 bytes) - added by chileverde 16 years ago.

Download all attachments as: .zip

Change History (5)

Changed 16 years ago by chileverde

Attachment: code.tar.gz added

comment:1 Changed 16 years ago by chileverde

It seems there is a mem leak somewhere. When I start the attached server with:       
twistd -y server.py       
is uses around 7mb of mem, but then I run:       
ab -n10000 -c4 http://host:8080/    (from a different pc of course)   
memory starts getting used. When it finishes running, the memory is still       
used up to (96% of 128 mb), and it doesn't free up until I kill the twisted       
process.       
       
System:    
Ubuntu 2.6.10-5-386   
Python 2.4.1 (#2, Mar 30 2005, 21:51:10)   
[GCC 3.3.5 (Debian 1:3.3.5-8ubuntu2)] on linux2   
   
Please let me know if I can help in any way.

comment:2 Changed 16 years ago by chileverde

Sorry for the double post. Also forgot to add:   
>>> import twisted  
>>> twisted.__version__  
'2.2.0'  
>>>

comment:3 Changed 16 years ago by jknight

Cc: itamarst added

Verified leak; appears to be because of the components backward compatibility layer -- removing components.backwardsCompatImplements(Resource) from resource.py made the leak not appear.

Probably the "_fixedClasses" dictionary in components.py should be a weak hash, itamar?

comment:4 Changed 16 years ago by foom

Resolution: fixed
Status: newclosed

(In [16085]) Use an attribute on the class to store fixedness instead of a hashtable. This removes the leak when creating and discarding classes.

Fixes #1495

Note: See TracTickets for help on using tickets.