Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2008-11-14 14:54:54 -0500
committerThomas Watson2008-11-14 14:54:54 -0500
commit2bc595199a478058ce0f7f724bb4f209889e3bdd (patch)
treecf0db95cb3e8caf6ec9174b9fb1ea31cccecdff1 /bundles/org.eclipse.osgi/resolver
parent3c0c0dfacf202d114cdb663e26253b13d194f1ac (diff)
downloadrt.equinox.framework-2bc595199a478058ce0f7f724bb4f209889e3bdd.tar.gz
rt.equinox.framework-2bc595199a478058ce0f7f724bb4f209889e3bdd.tar.xz
rt.equinox.framework-2bc595199a478058ce0f7f724bb4f209889e3bdd.zip
Bug 255392 GenericDescription objects are not flushed from memory
Diffstat (limited to 'bundles/org.eclipse.osgi/resolver')
-rw-r--r--bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/BundleDescriptionImpl.java4
-rw-r--r--bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java1
-rw-r--r--bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateReader.java9
3 files changed, 10 insertions, 4 deletions
diff --git a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/BundleDescriptionImpl.java b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/BundleDescriptionImpl.java
index 41a0dc94f..c5f3ccf01 100644
--- a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/BundleDescriptionImpl.java
+++ b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/BundleDescriptionImpl.java
@@ -521,10 +521,6 @@ public class BundleDescriptionImpl extends BaseDescriptionImpl implements Bundle
setFullyLoaded(false);
LazyData tempData = lazyData;
lazyData = null;
- if (tempData == null || tempData.selectedExports == null)
- return;
- for (int i = 0; i < tempData.selectedExports.length; i++)
- currentState.getReader().objectTable.remove(new Integer(((ExportPackageDescriptionImpl) tempData.selectedExports[i]).getTableIndex()));
}
void setDynamicStamps(HashMap dynamicStamps) {
diff --git a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java
index 2d6360753..3d9a9058a 100644
--- a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java
+++ b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java
@@ -814,6 +814,7 @@ public abstract class StateImpl implements State {
BundleDescription[] bundles = getBundles();
for (int i = 0; i < bundles.length; i++)
((BundleDescriptionImpl) bundles[i]).unload();
+ reader.flushLazyObjectCache();
}
}
diff --git a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateReader.java b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateReader.java
index 8358aef59..6f55a7a67 100644
--- a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateReader.java
+++ b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateReader.java
@@ -15,6 +15,7 @@ import java.lang.ref.WeakReference;
import java.lang.reflect.Constructor;
import java.security.AccessController;
import java.util.*;
+import java.util.Map.Entry;
import org.eclipse.osgi.framework.util.SecureAction;
import org.eclipse.osgi.service.resolver.*;
import org.osgi.framework.InvalidSyntaxException;
@@ -719,4 +720,12 @@ class StateReader {
}
return skipBytes;
}
+
+ synchronized void flushLazyObjectCache() {
+ for (Iterator entries = objectTable.entrySet().iterator(); entries.hasNext();) {
+ Map.Entry entry = (Entry) entries.next();
+ if (entry.getValue() instanceof ExportPackageDescription || entry.getValue() instanceof GenericDescription)
+ entries.remove();
+ }
+ }
}

Back to the top