Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345715 - [implementation] AnnotationModel.fModificationStamp leaks annotations
Summary: [implementation] AnnotationModel.fModificationStamp leaks annotations
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.7.1   Edit
Assignee: Dani Megert CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-13 07:02 EDT by Anton Leherbauer CLA
Modified: 2011-08-11 03:05 EDT (History)
2 users (show)

See Also:
markus.kell.r: review+


Attachments
Suggested fix (1.21 KB, patch)
2011-05-13 07:05 EDT, Anton Leherbauer CLA
daniel_megert: iplog+
daniel_megert: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Leherbauer CLA 2011-05-13 07:02:01 EDT
AnnotationModel.fModificationStamp is assigned to the last AnnotationModelEvent instance and thus holds back references to annotations contained in the change (until the next event is created).  This is bad if an annotation itself contains references to "expensive" resources which would otherwise be garbage collected.
See also bug 331232 for such a case.

The fix should be simple and safe: Just assign a new Object() instead of the model event.
Comment 1 Anton Leherbauer CLA 2011-05-13 07:05:54 EDT
Created attachment 195579 [details]
Suggested fix
Comment 2 Markus Keller CLA 2011-05-13 11:23:09 EDT
Looks good, but we're already in RC2. Do you need this for 3.7 or is 3.8 good enough?
Comment 3 Anton Leherbauer CLA 2011-05-16 02:36:06 EDT
I guess 3.8 is sufficient.
Comment 4 Dani Megert CLA 2011-05-16 04:26:27 EDT
We could also put it in 3.7.1 if that helps.
Comment 5 Anton Leherbauer CLA 2011-05-16 04:30:17 EDT
(In reply to comment #4)
> We could also put it in 3.7.1 if that helps.

Yes, thanks, that would be even better.
Comment 6 Dani Megert CLA 2011-08-05 03:21:32 EDT
Comment on attachment 195579 [details]
Suggested fix

Committed to HEAD with the following update to the copyright header:

Anton Leherbauer <anton.leherbauer@windriver.com> - [implementation] AnnotationModel.fModificationStamp leaks annotations - http://bugs.eclipse.org/345715
Comment 7 Dani Megert CLA 2011-08-05 03:30:47 EDT
Fixed in R3_7_maintenance.
Comment 8 Dani Megert CLA 2011-08-11 03:05:51 EDT
Verified in M20110810-0800.