Bug 269476 - testInitJDTPlugin() seems to leak several DeltaProcessor and JavaModelManager
Summary: testInitJDTPlugin() seems to leak several DeltaProcessor and JavaModelManager
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M7   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks: 260739
  Show dependency tree
 
Reported: 2009-03-20 04:57 EDT by David Audel CLA
Modified: 2009-04-28 06:02 EDT (History)
2 users (show)

See Also:


Attachments
Proposed fix (1.55 KB, patch)
2009-03-20 05:06 EDT, David Audel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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