[Checkins] [zopefoundation/Zope] 054cd1: Adding a branch from 2.11 for ZeOmega to work on f...

GitHub noreply at github.com
Tue Feb 26 16:41:14 UTC 2013


  Branch: refs/heads/zeomega-2.11-memory-fixes
  Home:   https://github.com/zopefoundation/Zope
  Commit: 054cd12ed074324bcf26e9f82120221ebe919685
      https://github.com/zopefoundation/Zope/commit/054cd12ed074324bcf26e9f82120221ebe919685
  Author: Brad Allen <bradallen137 at gmail.com>
  Date:   2010-02-02 (Tue, 02 Feb 2010)

  Log Message:
  -----------
  Adding a branch from 2.11 for ZeOmega to work on fixes related to memory leaks in related to Shared.ZRDB.Results. See Launchpad ticket: https://bugs.launchpad.net/zope2/+bug/143917


  Commit: 061ba6d33768168ef7aa85777d357b2fb9d2b0c7
      https://github.com/zopefoundation/Zope/commit/061ba6d33768168ef7aa85777d357b2fb9d2b0c7
  Author: Brad Allen <bradallen137 at gmail.com>
  Date:   2010-02-02 (Tue, 02 Feb 2010)

  Changed paths:
    M lib/python/Shared/DC/ZRDB/Results.py

  Log Message:
  -----------
  First stab at breaking Results reference cycle based on feedback from Tres. The 'r' class declaration has been moved outside Results.__init__ into a class factory function. I don't know if this really breaks the reference cycle but am committing so others can review (all current tests are passing).


  Commit: 4b0dd1187e4b8773a95ee1ee436ad30d7b95a784
      https://github.com/zopefoundation/Zope/commit/4b0dd1187e4b8773a95ee1ee436ad30d7b95a784
  Author: Brad Allen <bradallen137 at gmail.com>
  Date:   2010-02-02 (Tue, 02 Feb 2010)

  Changed paths:
    M lib/python/Shared/DC/ZRDB/Results.py

  Log Message:
  -----------
  Changed the class declaration inside the record_cls_factory to use the builtin 'type' class constructor to  avoid any chance of outer scope references leaking in closure-style (this is probably over paranoid but it can't hurt).


  Commit: 8e3a86a3403327a85c3bfad95d9cc6d61243d561
      https://github.com/zopefoundation/Zope/commit/8e3a86a3403327a85c3bfad95d9cc6d61243d561
  Author: Brad Allen <bradallen137 at gmail.com>
  Date:   2010-02-04 (Thu, 04 Feb 2010)

  Changed paths:
    M lib/python/Shared/DC/ZRDB/Results.py
    A lib/python/Shared/DC/ZRDB/namedtuple.py
    M lib/python/Shared/DC/ZRDB/tests/test_results.py

  Log Message:
  -----------
  The prior commit did not fix the memory leak (apparently there was no real closure reference from the Results to the 'r' class/instance). 

Jeff Rush indicated suspicion that one of the C extensions involved might not be releasing memory properly, but he has not had a chance to verify that. In the meantime I've created an experimental pure Python version of the Results class which does not rely on any C extensions such as Record.c or ExtensionClass. 

Unfortunately it is not passing one of the tests related to Acquisition, because I am not yet clear on how to implement that using pure Python. One Acquisition-related test has been commented out.

Three tests have been commented out related to string substitution, because the current implementation relies on namedtuple, which does not support dictionary style string substitution. I have yet to identify how to intercept string substitution so I can return the appropriate dictionary.

One test has been commented out because I did not see a reason for it. Why should slicing on a record raise an exception? The namedtuple can support slicing.

This has not been tested in a real application yet.


  Commit: 2f2222ca6fb2c9952fa191cf9162ea25b8e8e925
      https://github.com/zopefoundation/Zope/commit/2f2222ca6fb2c9952fa191cf9162ea25b8e8e925
  Author: Brad Allen <bradallen137 at gmail.com>
  Date:   2010-02-04 (Thu, 04 Feb 2010)

  Changed paths:
    M lib/python/DocumentTemplate/DT_In.py

  Log Message:
  -----------
  Sam suggested tweak to DocumentTemplate to make sure TemplateDict is not holding a reference to the ResultSet. Preliminary testing shows memory usage stabilizes, but more testing is needed to verify (this was tested without any of the changes to Results.py which were introduced in this branch.)


  Commit: e3a9c280aa6e70c7f9ddff13207d9aee541672dc
      https://github.com/zopefoundation/Zope/commit/e3a9c280aa6e70c7f9ddff13207d9aee541672dc
  Author: Brad Allen <bradallen137 at gmail.com>
  Date:   2010-02-06 (Sat, 06 Feb 2010)

  Changed paths:
    M lib/python/Shared/DC/ZRDB/Results.py
    M lib/python/Shared/DC/ZRDB/tests/test_results.py

  Log Message:
  -----------
  Added test case for dictionary-style attribute access (like record['foo'], and fixed __setitem__ functionality which was broken.


Compare: https://github.com/zopefoundation/Zope/compare/054cd12ed074^...e3a9c280aa6e


More information about the checkins mailing list