Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory Leak in InstanceModelUtil #2924

Open
joeseibel opened this issue Feb 4, 2025 · 0 comments
Open

Memory Leak in InstanceModelUtil #2924

joeseibel opened this issue Feb 4, 2025 · 0 comments

Comments

@joeseibel
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant