From: Brandon K. <ki...@ca...> - 2005-08-15 21:07:49
|
I've checked in a major memory leak bug fix into CVS and is available on http://pymerase.caltech.edu. I've created ten unittests which pass now after the patch and did some additional tests. I still may need more testing. If any new bugs are found, please submit a bug report. If anyone would like more information about how to take advantage of the new memory saving abilities, please send a message to the mailing lists. Enjoy! DETAILS: Fixes for bugs 1256258 and 1256271. Memory leak should now be fixed. Ten test cases have be implemented in tests/TestMemLeak.py... All ten pass currently. I tested for slow down in creating and commiting 10,000 objects to a database. It has a 0.2 sec slow down in a 94 sec time frame. The fix includes an object cache which reuses objects which have already been pulled into memory (using weakrefs). Also, there is a new function for DBClass objects called _destroySelf. This function must be called before calling del on an DBClass object. This is only useful when you want to free up some memory when your done with a DBClass object, but the program is going to continue to run. It works by removing all references to the class your trying to remove so that the python ref count will be low enough for garbage collection to free up the memory. Calling del without calling _destroySelf will NOT remove the object from memory. To go back to the memory leaky version check out tag 'pre_aug_2005_mem_patch'. |