When using some of the utility methods in InstanceModelUtil, it is possible to create a memory leak. Internally, InstanceModelUtil caches some computations in the static fields boundSWCache and boundBusConnections. The class also has a method clearCache() which should be called upon each run of every analysis, but sometimes isn't. If the cache is not cleared, then old instance models which are no longer used stay in the caches until OSATE terminates. For example, the class BusLoadModelBuilder, which is part of the Analyze Bus Load analysis, calls methods which populate the cache, but does not call clearCache().
After discussing this with @AaronGreenhouse and @lwrage, we think it is best to simply remove the caches boundSWCache and boundBusConnections as well as the method clearCache() from InstanceModelUtil. In this case, caching seems like an over-optimization without much benefit.
When using some of the utility methods in
InstanceModelUtil, it is possible to create a memory leak. Internally,InstanceModelUtilcaches some computations in the static fieldsboundSWCacheandboundBusConnections. The class also has a methodclearCache()which should be called upon each run of every analysis, but sometimes isn't. If the cache is not cleared, then old instance models which are no longer used stay in the caches until OSATE terminates. For example, the classBusLoadModelBuilder, which is part of the Analyze Bus Load analysis, calls methods which populate the cache, but does not callclearCache().After discussing this with @AaronGreenhouse and @lwrage, we think it is best to simply remove the caches
boundSWCacheandboundBusConnectionsas well as the methodclearCache()fromInstanceModelUtil. In this case, caching seems like an over-optimization without much benefit.