Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 219051 - Horrendous memory leaks in ECrossReferenceAdapters
Summary: Horrendous memory leaks in ECrossReferenceAdapters
Status: CLOSED FIXED
Alias: None
Product: OCL
Classification: Modeling
Component: Core (show other bugs)
Version: 1.2.0   Edit
Hardware: PC Linux
: P1 major (vote)
Target Milestone: M6   Edit
Assignee: Christian Damus CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-14 23:54 EST by Christian Damus CLA
Modified: 2011-05-27 02:40 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Damus CLA 2008-02-14 23:54:39 EST
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
Comment 1 Christian Damus CLA 2008-02-15 00:21:20 EST
Committed fixes for the specific problems listed, above.  More changes will follow, as there are still plenty of objects leaking.
Comment 2 Christian Damus CLA 2008-02-15 19:07:33 EST
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.
Comment 3 Christian Damus CLA 2008-02-27 20:03:38 EST
Fix available in HEAD: 1.2.0.I200802271900.
Comment 4 Ed Willink CLA 2011-05-27 02:37:55 EDT
Closing after over a year in verified state.
Comment 5 Ed Willink CLA 2011-05-27 02:40:42 EDT
Closing after over a year in verified state.