Next Chapter | Up | Next Section | Contents

Cache Management


The database used by Zope has an object cache that helps to manage movement of objects to and from the database. When an object is retrieved from the database, it is copied to the cache. Subsequent retrievals can be performed very quickly from the cache. The cache also provides for removing unneeded objects from memory. This is performed through cache garbage collection.

Garbage collection is performed by scanning objects in the database cache. Objects that have not been accessed in a long time are deactivated. Deactivating an object causes all of its data to be freed from memory. The object is placed in a deactivated state. Its data will be reloaded as necessary the next time the object is used. Objects that are only referenced by the cache are removed from the cache and memory. Deactivating an object often makes it possible to deallocate other objects.

Cache garbage collection is performed automatically when the database cache size exceeds a target size set in the Cache Parameters view. Automatic garbage collection is performed incrementally to avoid significant impacts on performance.

Manual garbage collection can also be used to force either one entire scan through the cache, or repeated scans until the cache size can't be made smaller.

Next Chapter | Up | Next Section | Contents

Banner.Novgorod.Ru