• Arnaud Fontaine's avatar
    Portal Type as Classes: Fix memory leak: reset erp5.* classes were never GC (#20170126-19C38D8). · 73b747dd
    Arnaud Fontaine authored
    zope.{interface,component} implement Interfaces through __implements__,
    __implemented__ (both implementedBy instances) and __provides__ (ClassProvides
    instance) attributes set on the class itself through implementedByFallback
    (zope.interface.declarations).
    
    However, this implementation creates circular references by referencing the
    class itself and thus erp5.* classes (and all its Accessors instances) were
    never GC even after a reset.
    
    When running testXHTML and installing the Unit Tests bt5s:
      * After 10 resets:  21MB leak (~  7% of Zope process USS).
      * After 20 resets:  70MB leak (~ 18% of Zope process USS).
      * After 28 resets: 122MB leak (~ 26% of Zope process USS).
    73b747dd
portal_type_class.py 17.4 KB