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 0F4CC200C5A for ; Tue, 18 Apr 2017 12:17:46 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 0E0F6160BAF; Tue, 18 Apr 2017 10:17:46 +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 36E18160B90 for ; Tue, 18 Apr 2017 12:17:45 +0200 (CEST) Received: (qmail 4501 invoked by uid 500); 18 Apr 2017 10:17:44 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 4480 invoked by uid 99); 18 Apr 2017 10:17:44 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Apr 2017 10:17:44 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 76E5EC0027 for ; Tue, 18 Apr 2017 10:17:43 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id RxkHeS_g8DDA for ; Tue, 18 Apr 2017 10:17:42 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 55D815FB5C for ; Tue, 18 Apr 2017 10:17:42 +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 DFA8AE00A6 for ; Tue, 18 Apr 2017 10:17:41 +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 9C39321B44 for ; Tue, 18 Apr 2017 10:17:41 +0000 (UTC) Date: Tue, 18 Apr 2017 10:17:41 +0000 (UTC) From: =?utf-8?Q?Torsten_B=C3=B8gh_K=C3=B6ster_=28JIRA=29?= To: dev@lucene.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (SOLR-10506) Possible memory leak upon collection reload MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 18 Apr 2017 10:17:46 -0000 [ https://issues.apache.org/jira/browse/SOLR-10506?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] Torsten B=C3=B8gh K=C3=B6ster updated SOLR-10506: --------------------------------------- Attachment: solr_gc_path_via_zk_WatchManager.png The strong references via schema index reader > Possible memory leak upon collection reload > ------------------------------------------- > > Key: SOLR-10506 > URL: https://issues.apache.org/jira/browse/SOLR-10506 > Project: Solr > Issue Type: Bug > Security Level: Public(Default Security Level. Issues are Public)=20 > Components: Server > Affects Versions: 6.5 > Reporter: Torsten B=C3=B8gh K=C3=B6ster > Attachments: solr_collection_reload_13_cores.png, solr_gc_path_vi= a_zk_WatchManager.png > > > Upon manual Solr Collection reloading, references to the closed {{SolrCor= e}} are not fully removed by the garbage collector as a strong reference to= the {{ZkIndexSchemaReader}} is held in a ZooKeeper {{Watcher}} that watche= s for schema changes. > In our case, this leads to a massive memory leak as managed resources are= still referenced by the closed {{SolrCore}}. Our Solr cloud environment ut= ilizes rather large managed resources (synonyms, stopwords). To reproduce, = we fired out environment up and reloaded the collection 13 times. As a resu= lt we fully exhausted our heap. A closer look with the Yourkit profiler rev= ealed 13 {{SolrCore}} instances, still holding strong references to the gar= bage collection root (see screenshot 1). > Each {{SolrCore}} instance holds a single path with strong references to = the gc root via a `Watcher` in `ZkIndexSchemaReader` (see screenshot 2). Th= e {{ZkIndexSchemaReader}} registers a close hook in the {{SolrCore}} but th= e Zookeeper is not removed upon core close. > We supplied a Github Pull Request that extracts the zookeeper `Watcher` a= s a static inner class. To eliminate the memory leak, the schema reader is = held inside a `WeakReference` and the reference is explicitly removed on co= re close. > Initially I wanted to supply a test case but unfortunately did not find a= good starting point ... -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org