[
https://issues.apache.org/jira/browse/KARAF-5395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16185712#comment-16185712
]
Guillaume Nodet edited comment on KARAF-5395 at 9/29/17 11:31 AM:
------------------------------------------------------------------
There's no concept of separate installation requests. What I mean is that the
whole resolution is recomputed whenever the resolver kicks in. The commands do
not allow leveraging the full API.
The most generic call is the following:
https://github.com/apache/karaf/blob/master/features/core/src/main/java/org/apache/karaf/features/FeaturesService.java#L129-L131
Whenever a feature installation / uninstallation is performed, a requirement is
added / removed from the list of requirements, and the whole wiring is
recomputed and applied.
You may also want to consider using {{dependency="true"}} flag, as if you have
multiple features requiring the same bundle with {{dependency="true"}}, a
single resource will be used usually. The reason is that by default,
dependencies are put in the parent region, so the 2 same bundles are put in the
same region, and then one is discarded before the resolution.
was (Author: gnt):
There's no concept of separate installation requests. What I mean is that the
whole resolution is recomputed whenever the resolver kicks in. The commands do
not allow leveraging the full API.
The most generic call is the following:
https://github.com/apache/karaf/blob/master/features/core/src/main/java/org/apache/karaf/features/FeaturesService.java#L129-L131
Whenever a feature installation / uninstallation is performed, a requirement is
added / removed from the list of requirements, and the whole wiring is
recomputed and applied.
You may also want to consider using {{dependency="true"}} flag, as if you have
multiple features requiring the same bundle with {{dependency="true"}}, a
single resource will be used usually. The reason is that by default,
dependencies are put in the parent region.
> ResourceImpl/RequirementImpl/CapabilityImpl do not correctly implement their
> OSGi interface contracts
> -----------------------------------------------------------------------------------------------------
>
> Key: KARAF-5395
> URL: https://issues.apache.org/jira/browse/KARAF-5395
> Project: Karaf
> Issue Type: Bug
> Components: karaf-feature
> Affects Versions: 4.2.0, 4.1.2, 4.0.10
> Reporter: Robert Varga
> Assignee: Guillaume Nodet
> Priority: Critical
>
> This is a follow-up of downstream issue tracked at
> https://bugs.opendaylight.org/show_bug.cgi?id=9218.
> OpenDaylight uses auto-generated features, which may end up packaging a
> bundle multiple times in separate features -- which can be regarded as a bug,
> but it certainly is counter-intuitive.
> Using a simple test case of wanting to install all features at the same time
> triggers huge memory usage spike in Felix Resolver.
> Since ResourceImpl does not explictly override hashCode()/equals() according
> to org.osgi.resource.Resource interface contract, every resource declaration
> in a feature is treated as unique -- disregarding the fact that multiple
> bundle declarations are actually pointing to the same bundle.
> This cascades to both RequirementImpl and CapabilityImpl, hence each such
> duplicate bundle is added to the set of Requirements to be resolved and its
> capabilities are added to potential candidates -- leading to Felix Resolver
> having a large problem space (what to resolve) and also having a large
> solution space (how to resolve) -- leading to polynomial explosion in CPU and
> memory requirements.
> The amount of memory consumed by OpenDaylight Nitrogen RC3 has been observed
> at 1.2GB, e.g. with a heap smaller than that, the container runs into OOM
> during feature:install before actual installation starts.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)