Memory leak in zope.i18nmessageid.MessageFactory

Bug #257657 reported by Gary Poster
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
BlueBream
Fix Committed
Undecided
Unassigned
Zope 2
Fix Released
High
Unassigned
zope.i18nmessageid
Fix Released
High
Tres Seaver

Bug Description

(zope.i18nmessageid-3.4.3)

The following code leaks memory:

import zope.i18nmessageid
_ = zope.i18nmessageid.MessageFactory("testing")
while 1:
    _('a string')

Apparently the message instances (C code) are not being garbage collected.

This affects persistent objects that have a reference to a message (every time the state is loaded, a new version of the same string is created and never released).

It will also affect any code that generates message instances dynamically; templates, for instance, may be affected.

Revision history for this message
Fred Drake (fdrake) wrote : Re: [Bug 257657] [NEW] Memory leak in zope.i18nmessageid.MessageFactory

This has been reproduced using both Python 2.4 and 2.5.

Revision history for this message
Fred Drake (fdrake) wrote :

Note that using Message directly, instead of MessageFactory, exhibits
the same problem.

Revision history for this message
Brian Sutherland (jinty) wrote :
Tres Seaver (tseaver)
affects: zope3 → zopetoolkit-project
Changed in zopetoolkit-project:
assignee: nobody → Tres Seaver (tseaver)
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Tres Seaver (tseaver) wrote :
Changed in zopetoolkit-project:
status: Confirmed → Fix Released
Changed in zope2:
importance: Undecided → High
milestone: none → 2.12.5
status: New → Fix Committed
Changed in bluebream:
status: New → Fix Committed
Tres Seaver (tseaver)
affects: zopetoolkit-project → zope.i18nmessageid
Changed in zope2:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.