Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7175D200CFC for ; Thu, 28 Sep 2017 21:50:06 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 6FBB11609B4; Thu, 28 Sep 2017 19:50:06 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8FE721609CD for ; Thu, 28 Sep 2017 21:50:05 +0200 (CEST) Received: (qmail 401 invoked by uid 500); 28 Sep 2017 19:50:04 -0000 Mailing-List: contact issues-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@karaf.apache.org Delivered-To: mailing list issues@karaf.apache.org Received: (qmail 389 invoked by uid 99); 28 Sep 2017 19:50:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Sep 2017 19:50:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 50E171A3CC4 for ; Thu, 28 Sep 2017 19:50:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.201 X-Spam-Level: X-Spam-Status: No, score=-99.201 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id mV6eOwIZ4ca7 for ; Thu, 28 Sep 2017 19:50:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 51D255F3CE for ; Thu, 28 Sep 2017 19:50:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 13CDDE0E4F for ; Thu, 28 Sep 2017 19:50:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 508BA242B4 for ; Thu, 28 Sep 2017 19:50:00 +0000 (UTC) Date: Thu, 28 Sep 2017 19:50:00 +0000 (UTC) From: "Robert Varga (JIRA)" To: issues@karaf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (KARAF-5395) ResourceImpl/RequirementImpl/CapabilityImpl do not correctly implement their OSGi interface contracts MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 28 Sep 2017 19:50:06 -0000 [ https://issues.apache.org/jira/browse/KARAF-5395?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Robert Varga updated KARAF-5395: -------------------------------- Description: 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.6GB, e.g. with a heap smaller than that, the container runs into OOM during feature:install before actual installation starts. was: 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.6GB, e.g. with a heap smaller than that, the container runs into OOM. > 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 > 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.6GB, 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)