Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 363032

Summary: [codegen] Fix memory leak
Product: [Modeling] OCL Reporter: Ed Willink <ed>
Component: CoreAssignee: OCL Inbox <mdt-ocl-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2.0   
Target Milestone: M4   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Attachments:
Description Flags
Heap trace in 64MB none

Description Ed Willink CLA 2011-11-07 04:57:52 EST
46 Xtext tests now fail on Hudson with a 32 MB VM, although they pass on Win32.

As a workaround the VM has been increased to 64 MB.

The new codegen tests probably have a memory leak.
Comment 1 Ed Willink CLA 2011-11-12 02:49:27 EST
(In reply to comment #0)
> The new codegen tests probably have a memory leak.

No problem with the new codegen tests; they don't do much allocation.

The MarkupTests had significant leaks, and a few other tests also leaked. Probably the extra classes and tests for the codegen tipped the balance via PermGen.

[When debugging use Visual VM and see what MetaModelManager classes persist. Additionally uncomment references to LiveInstances in MetaModelManagerResourceAdapter to get diagnostic help.]

Now works in 25MB (but not 24 MB) on Win 32.

Pushed to master.
Comment 2 Ed Willink CLA 2011-11-12 11:25:27 EST
Instrumenting ResourseSet rather than MetaModelManager reveal 19 live instances after 366 tets. Many of these are referrenced via statics.
- one in PivotTestSuite
- one for each editor injector
- the global package registry

It seems quite hard to get them all released, particularly without affecting the startup of subsequent tests. e.g we need to unregister Ecore.ecore and reregister without using the normal statics.

This therefore seems an unrealistic effort. Just set the VM back to 64 MB.
Comment 3 Ed Willink CLA 2012-06-25 10:51:59 EDT
Created attachment 217813 [details]
Heap trace in 64MB

Tests started to fail again on Hudson.

Immediate problem was increased usage by UML stereotypes.

On investigation, failure to wipe the EValidator.Registry and non-weak references in the ExecutorStandardLibrary locked in steadily increasing resources.

Attached shows a successful run of /org.eclipse.ocl.examples.xtext.tests/.settings/org.eclipse.ocl.examples.xtext.tests (standalone) (64M).launch on a quad-core 32 bit Intel Vista machine.
Comment 4 Ed Willink CLA 2014-05-27 09:45:29 EDT
CLOSED after more than a year in RESOLVED state.
Comment 5 Ed Willink CLA 2014-05-27 09:53:09 EDT
and CLOSE