Bug 244849

Summary: [implementation] Memory leak in DeltaProcessingState#externalTimeStamps ?
Product: [Eclipse Project] JDT Reporter: John Arthorne <john.arthorne>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bimargulies, Olivier_Thomann, peterk
Version: 3.5Keywords: performance
Target Milestone: 3.5 M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Screen shot of YourKit trace
none
Proposed fix
none
Proposed fix none

Description John Arthorne CLA 2008-08-21 13:51:28 EDT
Created attachment 110604 [details]
Screen shot of YourKit trace

Build id: I20080812-0800

I was looking at a YourKit dump of memory in my self-hosting workspace. This is a workspace that I have been using for over a year. I noticed a "DeltaProcessingState" object that was very large. Drilling down, I see most of the space is used by the "externalTimeStamps" field, holding 750KB of memory. This is a hash table of Path->Long objects.  Looking at the path objects, I see paths to *very* old plugins that I no longer have on disk (from 3.4 M2 period). It looks like this table isn't been cleaned up when my target platform changes, and so this map just keeps growing.
Comment 1 Jerome Lanneluc CLA 2008-09-04 13:07:38 EDT
Created attachment 111688 [details]
Proposed fix

This fix now remembers the timestamps when the project is created, and removes unused timestamps when the project is deleted. 

The fix also makes sure to cleanup the timestamps on shutdown so that the leaks are completely cleared.

Some tests where also adjusted as they relied on the leak.

To verify, only the implementation can be checked.
Comment 2 Jerome Lanneluc CLA 2008-09-04 13:10:42 EDT
Created attachment 111689 [details]
Proposed fix

Incomplete patch was attached
Comment 3 Jerome Lanneluc CLA 2008-09-05 04:53:34 EDT
Fix released for 3.5M2
Comment 4 Jerome Lanneluc CLA 2008-09-05 06:30:17 EDT
*** Bug 216446 has been marked as a duplicate of this bug. ***
Comment 5 Olivier Thomann CLA 2008-09-15 09:56:10 EDT
Verified for 3.5M2 using I20080914-2000
Comment 6 Jerome Lanneluc CLA 2008-09-19 10:04:53 EDT
*** Bug 245779 has been marked as a duplicate of this bug. ***