Bug 269476

Summary: testInitJDTPlugin() seems to leak several DeltaProcessor and JavaModelManager
Product: [Eclipse Project] JDT Reporter: David Audel <david_audel>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: frederic_fusier, srikanth_sankaran
Version: 3.5Keywords: performance
Target Milestone: 3.5 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 260739    
Attachments:
Description Flags
Proposed fix none

Description David Audel CLA 2009-03-20 04:57:53 EDT
build I20090317-1745

FullSourceWorkspaceModelTests#testInitJDTPlugin() seems to leak several DeltaProcessor and JavaModelManager.

When testInitJDTPlugin() simulate restart then a new JavaModelManager in created but the old DeltaProcessor stored in DeltaProcessingState#deltaProcessors is not removed from the ThreadLocalMap of the main thread and this DeltaProcessor references the old JavaModelManager.

As the JavaModelManager is a big object and testInitJDTPlugin() simulate restart 20 times , this test leaks around 100Mb.
Comment 1 David Audel CLA 2009-03-20 05:06:43 EDT
Created attachment 129427 [details]
Proposed fix

This patch set null the DeltaProcessor of the main thread when the test simulates restart. The other DeltaProcessors will disappear when their thread will disappear.

It should solve the leak in the performance test.
Comment 2 David Audel CLA 2009-03-20 05:11:27 EDT
I released the fix in HEAD for 3.5.

It fix only the problem in the performance test but the problem could also occur when jdtcore is restarted. Even if it is not a common case we should also fix it.
Comment 3 Frederic Fusier CLA 2009-03-20 05:15:24 EDT
(In reply to comment #1)
> Created an attachment (id=129427) [details]
> Proposed fix
> 
> This patch set null the DeltaProcessor of the main thread when the test
> simulates restart. The other DeltaProcessors will disappear when their thread
> will disappear.
> 
> It should solve the leak in the performance test.
> 
And also while running JDT/Core mode tests (see bug 260739)
Comment 4 David Audel CLA 2009-03-23 06:40:07 EDT
Fix the problem in jdtcore would require too much modifications for an almost useless benefit because the restart of jdtcore never occurs.

The fix for the tests is sufficient. I close this bug as FIXED.
Comment 5 Srikanth Sankaran CLA 2009-04-28 06:02:20 EDT
Verified for 3.5M7 using I20090426-2000