Remove DESTROYED blueprint containers from states map
@@ -103,8 +103,13 @@ public class BlueprintStateService implements org.osgi.service.blueprint.contain
LOG.debug("Blueprint app state changed to " + state + " for bundle "
+ blueprintEvent.getBundle().getBundleId());
}
+ // DESTROYED blueprint containers should be removed from the map to avoid memory "leak/high consumption"
+ if (blueprintEvent.getType() == BlueprintEvent.DESTROYED) {
+ states.remove(blueprintEvent.getBundle().getBundleId());
+ } else {
states.put(blueprintEvent.getBundle().getBundleId(), blueprintEvent);
}
+ }
@Override
public void bundleChanged(BundleEvent event) {
