Tremendous slowdown due to garbage collection

Terry Reedy tjreedy at udel.edu
Sun Apr 27 15:33:56 EDT 2008


"Dieter Maurer" <dieter at handshake.de> wrote in message 
news:x7y76zte0h.fsf at handshake.de...
| We observed similar very bad behaviour -- in a Web application server.
| Apparently, the standard behaviour is far from optimal when the
| system contains a large number of objects and occationally, large
| numbers of objects are created in a short time.
| We have seen such behaviour during parsing of larger XML documents, for
| example (in our Web application).

Does the standard alternative behavior of temporarily turning cyclic gc off 
solve your problem?

Can this alternative be made easier by adding a context manager to gc 
module to use with 'with' statements?  Something like

with gc.delay() as dummy:
   <block>

with exit invoking the collector (or make that a delay keyword param?)

Do the docs need some improvement in this area?

tjr






More information about the Python-list mailing list