Community
Participate
Working Groups
1.2 M5 build. This problem was first noticed in UML scenarios involving the CacheAdapter, which is an ECrossReferenceAdapter that forces itself onto every EObject that it can reach from any given UML element, whether in a resource or not. Earlier in the 1.2 release, a dispose() API was added to the OCL class to facilitate the unloading of the environment's resource and any constraints that had been parsed by the OCL instance. This turned out not to be nearly enough; in some test cases in which OCL constraints are parsed in dozens of distinct resource sets, over 700 MB of memory can be leaked in the UML CacheAdapter, including typically dozens of instances of the UML.metamodel.uml. The chief culprit in this leak, in clients that properly dispose() their OCLs, is temporary objects. These include: - temporary classifiers such as CollectionTypes that are subsequently superseded by types already persisted in the TypeResolver - temporary classifiers (created by UMLReflection.getOCLType() method) used by the ValidationVisitor - ASTs created with errors, that never end up being appended to the OCL's Constraints list and/or TypeResolver because a ParserException is thrown to the client - in the 1.1 compatibility layer, the AbstractSyntaxBridge adapters are never removed from the OCLTypes manifest constants for the OCL Standard Library types
Committed fixes for the specific problems listed, above. More changes will follow, as there are still plenty of objects leaking.
Other temporary objects created by the still needed to be cleaned up. These included: * all other temporary classifiers created by UMLReflection::getOCLType() method * temporary operation-call arguments created by the TypeUtil::getResultTypeOf() method * unlike constraints, plain query expressions created by the OCLHelper were not being persisted in the Environment's resource, where they could later be unloaded when the environment is disposed These cases are now all addressed.
Fix available in HEAD: 1.2.0.I200802271900.
Closing after over a year in verified state.