Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
4.1, 4.1.1, 4.2, 4.2.1, 5.0-M1
-
None
Description
Under some use cases default ObjectStore implementation could lead to a considerable memory leak.
Conditions are following:
- Cayenne objects use flattened attributes
- Application uses a shared readonly context that is never cleaned or removed
If those conditions are met ObjectStore.trackedFlattenedPaths just slowly grows (speed depends on how many different objects with flattened paths are loaded) and never freed.
NOTE: ObjectStore.objectMap grows too in this case, but it's a weak-ref based map by default, so it's memory is actually reclaimed by the JVM, while ObjectStore.trackedFlattenedPaths is just a regular ConcurrentHashMap.