| Summary: | Potential leak of ContextInjectionListener | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Remy Suen <remy.suen> | ||||||
| Component: | E4 | Assignee: | Oleg Besedin <ob1.eclipse> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | major | ||||||||
| Priority: | P3 | ||||||||
| Version: | unspecified | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Created attachment 188806 [details]
Patch
The Requestor objects were retaining results of calculations which removed them from GC. The attached patch fixes the issue.
The patch also fixes the injection exception for some cases involving injection of optional fields or methods. That problem is not related to the leak, but I stumbled on it while testing the patch.
The patch also adds a new JUnit InjectionResultLeakTest to the core tests based on the Remy's test.
Patch applied to CVS Head. Thanks Remy for the test - that made it easy to figure out. (In reply to comment #1) > The patch also fixes the injection exception for some cases involving injection > of optional fields or methods. That problem is not related to the leak, but I > stumbled on it while testing the patch. Can this problem manifest itself easily in the form of a test case or is it a rare error condition? |
Created attachment 188782 [details] Java test file, this is not a patch. This is the _suspected_ reference trace using JDT's ref checking code. Please reproduce with the attached .java file (not a patch!). org.eclipse.e4.ui.model.application.ui.basic.impl.InputPartImpl java.lang.Object[0] -> org.eclipse.e4.ui.model.application.ui.basic.impl.InputPartImpl@893929 (elementId: null, tags: null org.eclipse.e4.core.internal.contexts.ContextObjectSupplier$ContextInjectionListener#result -> [Ljava.lang.Object;@88436f org.eclipse.e4.core.internal.contexts.TrackableComputationExt#runnable -> PartServiceImpl#setPart() org.eclipse.e4.core.internal.contexts.ContextObjectSupplier#outerComputation -> PartServiceImpl#setPart() java.util.HashMap$Entry#key -> org.eclipse.e4.core.internal.contexts.ContextObjectSupplier@1f938a8 java.util.HashMap$Entry[8] -> org.eclipse.e4.core.internal.contexts.ContextObjectSupplier@1f938a8=[java.lang.ref.WeakReference@ff java.util.HashMap#table -> [Ljava.util.HashMap$Entry;@ac0382 org.eclipse.e4.core.internal.di.InjectorImpl#injectedObjects -> {org.eclipse.e4.core.internal.contexts.ContextObjectSupplier@c08593=[java.lang.ref.WeakReference@e5 org.eclipse.e4.core.contexts.ContextInjectionFactory#injector -> org.eclipse.e4.core.internal.di.InjectorImpl@bb1311 java.lang.Class -> class org.eclipse.e4.core.contexts.ContextInjectionFactory