The Disclosure Management Web application manages the loading and unloading of the XBRL taxonomies that are registered in the Disclosure Management system. Because XBRL taxonomies can be large, they tend to take up a lot of memory resources available to the Java process. Additionally, every time a taxonomy is loaded (into memory), performance is affected. Disclosure Management has a taxonomy caching system that keeps loaded taxonomies in memory so subsequent requests for taxonomy resources can be derived from the cache rather than re-loading the taxonomy. The taxonomy system works as follows:
At startup, the taxonomy broker reads the list of registered taxonomies from the mappingtool.properties file.
A taxonomy cache object is created for each registered taxonomy (note that this does not mean that the taxonomy is loaded at this time - taxonomy loading is done on demand).
When a user requests a particular taxonomy, the taxonomy broker checks the corresponding taxonomy cache object:
If the taxonomy is already loaded, the request is fulfilled by providing the cached taxonomy.
If the taxonomy is not already loaded, the taxonomy is loaded into memory. (Note that this requires the additional overhead of loading the taxonomy before the user request is fulfilled.)
After the user request is fulfilled, the loaded taxonomy remains in memory. Any subsequent requests on the loaded taxonomy are fulfilled from the cache.
When a request is made on a cache taxonomy, a timestamp is registered in order to determine the “last accessed time” of the taxonomy.
The time stamp of the taxonomy subsequently helps to determine when it is safe to unload the taxonomy.
When certain criteria is met, a taxonomy is unloaded from memory. This action releases the associated resources from the Web application.
The criteria used to determine if a given taxonomy should be unloaded is:
Available Memory—When the memory available to the Java Virtual Machine (JVM) reaches a certain threshold, the least used taxonomies are unloaded until a certain amount of memory is recovered.
Unused Taxonomy—When a certain time has elapsed since a loaded taxonomy was last used or accessed, the taxonomy is unloaded.
Maximum Taxonomies Loaded—When the number of taxonomies that have been loaded meets or exceeds a specified threshold, the least used taxonomies are unloaded automatically.