Bug 244849 - [implementation] Memory leak in DeltaProcessingState#externalTimeStamps ?
Summary: [implementation] Memory leak in DeltaProcessingState#externalTimeStamps ?
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 M2   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
: 216446 245779 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-08-21 13:51 EDT by John Arthorne CLA
Modified: 2008-09-19 10:04 EDT (History)
3 users (show)

See Also:


Attachments
Screen shot of YourKit trace (45.61 KB, image/png)
2008-08-21 13:51 EDT, John Arthorne CLA
no flags Details
Proposed fix (4.89 KB, patch)
2008-09-04 13:07 EDT, Jerome Lanneluc CLA
no flags Details | Diff
Proposed fix (9.51 KB, patch)
2008-09-04 13:10 EDT, Jerome Lanneluc CLA
no flags Details | Diff

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