Bug 244060 - [update] UpdateSite retains memory
Summary: [update] UpdateSite retains memory
Status: CLOSED WONTFIX
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: P2 Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
: 262630 274681 287172 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-08-13 15:15 EDT by John Arthorne CLA
Modified: 2011-02-27 15:07 EST (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2008-08-13 15:15:50 EDT
UpdateSite has a static field that holds onto all instances of UpdateSite ever loaded. These instances should be flushed when no longer needed. When profiling I found this retained about 5MB of heap space in my self-hosting workspace which has several repositories available.
Comment 1 John Arthorne CLA 2009-05-01 16:22:43 EDT
From bug 274681: Another consequence of this caching is that when the site changes, the cache is not updated until the next session.
Comment 2 John Arthorne CLA 2009-05-01 16:22:48 EDT
*** Bug 274681 has been marked as a duplicate of this bug. ***
Comment 3 Ian Bull CLA 2009-05-01 19:28:32 EDT
I see two options:
1. Don't cache file:/ URIs
2. If it is a file:/ URI we can check the timestamp and clear the cache that way.

I am going to mark this RC1 as it would be good to get a fix in.
Comment 4 Pascal Rapicault CLA 2009-05-04 13:52:08 EDT
This issue existed in 3.4 and the problem is in figuring out the proper lifecycle.
Comment 5 John Arthorne CLA 2009-08-20 10:19:59 EDT
*** Bug 287172 has been marked as a duplicate of this bug. ***
Comment 6 Ian Bull CLA 2009-10-29 13:07:28 EDT
I have noticed a few bugs that are probably a result of this one.  I think people are:
1. creating an update site
2. generating a p2 repo from this (cool it works)
3. making some changes to the site.xml
4. generating again
5. Finding out that things are missing from their newly generated repo.

Since we cache the site.xml and step #2, we are actually ignoring their changes.  

This inevitably leads to a bug report that we can't reproduce because we just try their final site.xml and it works for us.
Comment 7 Pascal Rapicault CLA 2010-02-22 20:52:02 EST
*** Bug 262630 has been marked as a duplicate of this bug. ***
Comment 8 Andrew Niefer CLA 2010-04-22 16:44:32 EDT
Bug 309624 made changes to the caches to not cache local file: URIs and also to use SoftReferences.  This makes the situation better, but we can still have outdated http: cached sites if the gc never felt it necessary to clear the references and the remote site changed.