After a taxonomy is loaded into memory, a polling feature is provided to determine when a taxonomy can be unloaded. The polling system works in this way:
Every time a request is made on a taxonomy cache object, a time stamp is registered to determine the “last accessed time” of the taxonomy.
The time stamp subsequently helps to determine when a taxonomy cache object is a candidate for unloading; that is, Disclosure Management applies the “least recently used” or the LRU cache algorithm.
Disclosure Management spins two threads that are responsible for polling the taxonomy cache objects which have loaded taxonomies (in memory).
The first thread automatically runs every 60 seconds. It tests the amount of free memory that is available to the JVM (using the Runtime.freeMemory() Java API). If the amount of free memory is less than 1 MB, Disclosure Management automatically unloads the least recently used taxonomy cache objects until Disclosure Management has freed more than 1 MB of memory.
The second thread runs at a user-defined interval (using the taxonomy_cache_poll property). When this thread is enabled, the thread polls the taxonomy cache objects (with loaded taxonomies) and performs three tests to determine whether a taxonomy should be unloaded:
Available Memory—When the memory available to the JVM reaches a certain threshold, the least recently used taxonomies are unloaded until a certain amount of memory is recovered. This is the same test as the one performed by the first thread as discussed above. This test is covered in detail in JVM Memory Threshold .
Unused Taxonomy—When a certain amount of time has elapsed since a loaded taxonomy was last used or accessed, the taxonomy is unloaded.
Maximum Taxonomies Loaded—When the number of taxonomies loaded meets or exceeds a user specified threshold, the least used taxonomies are unloaded automatically.
This process is described at: Maximum Taxonomies Loaded Threshold .