Hi Dieter, Thanks for the tips.
Douwe Osinga wrote at 2003-10-29 10:52 +0100:
I am experiencing problems with the amount of memory Zope is using. I'm using Zope 2.6.2 and Windows 2000 server. Now, things work fine for days and then suddenly something goes wrong and the amount of memory in use by Zope increases until 2Gb or so and the process stops responding completely.
My current theory is that this happens when some requests take very long to answer (ie. 1 minute or so).
I see 3 potential causes (there may be more): [...] * you have memory leaks -- pieces of code that leak (usually) small amounts of memory. Over time, you loose more and more memory. You can use Shane's "LeakFinder" product to track this down. I installed the product and found out that when the memory consumption grows, I also get a *lot* of instances of IOBucket and OOBucket and similar named objects, but mostly DateTime objects. Since I had never heard of the first kind of objects and they sounded rather like basic building blocks, I put a patch on the DateTime. It gave me references to pieces of code that without a miss were doing lookups from the ZCatalogue, i.e. a ZClass that was instantiated with something like:
zobj = context.Catalog.getobject( catitem.data_record_id_ ) where zobj has properties of DateTime type, so that might be the problem. The logs actually suggest that this statement is then executed for 300 times a second, though the surrounding code does not seem to do that. Now, the ZClass is question is also derived from a class I created myself in Python, so that is probably where the memory leak is to be found. The thing is that I don't know what I'm looking for: how do I create a memory leak in Python? Doesn't the garbage collector clear these things? Any help is much appreciated. Douwe Osinga