The toolkit uses two mechanisms to limit the size of object caches. The first mechanism is a thread that operates in the background to remove expired objects from the cache. The toolkit assigns a timestamp to each object as it is placed in the cache. The thread compares each object's timestamp to the current timestamp and if the difference between the two exceeds a configurable limit, the thread removes the object from the cache. How often the thread performs the comparison is also configurable. Both configuration settings are in the toolkit definition (btt.xml) file.
The second mechanism consists of a set of settings in the toolkit definition file that control the number of objects stored in the cache. These setting specify the maximum number of types, the maximum number of instances for each type, and overall number of types and instances stored each object cache. See Limiting the size of an object cache.