Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C4666DA2B for ; Mon, 17 Sep 2012 17:59:11 +0000 (UTC) Received: (qmail 75997 invoked by uid 500); 17 Sep 2012 17:59:08 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 75920 invoked by uid 500); 17 Sep 2012 17:59:08 -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 75887 invoked by uid 99); 17 Sep 2012 17:59:08 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Sep 2012 17:59:08 +0000 Date: Tue, 18 Sep 2012 04:59:08 +1100 (NCT) From: "Tim Smith (JIRA)" To: dev@lucene.apache.org Message-ID: <270476157.88741.1347904748735.JavaMail.jiratomcat@arcas> In-Reply-To: <1327819396.87873.1347892087764.JavaMail.jiratomcat@arcas> Subject: [jira] [Commented] (LUCENE-4398) "Memory Leak" in TermsHashPerField memory tracking MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LUCENE-4398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13457196#comment-13457196 ] Tim Smith commented on LUCENE-4398: ----------------------------------- Looks like the culprit is DocFieldProcessorPerThread.trimFields() this method "releases" fields that were not seen recently for each field, this leaks 16 bytes from DocumentsWriter.bytesUsed's memory accounting > "Memory Leak" in TermsHashPerField memory tracking > -------------------------------------------------- > > Key: LUCENE-4398 > URL: https://issues.apache.org/jira/browse/LUCENE-4398 > Project: Lucene - Core > Issue Type: Bug > Affects Versions: 3.4 > Reporter: Tim Smith > > I am witnessing an apparent leak in the memory tracking used to determine when a flush is necessary. > Over time, this will result in every single document being flushed into its own segment as the memUsage will remain above the configured buffer size, causing a flush to be triggered after every add/update. > Best I can figure, this is being caused by TermsHashPerField's tracking of memory usage for postingsHash and/or postingsArray combined with multi-threaded feeding. > I suspect that the TermsHashPerField's postingsHash is growing in one thread, then, when a segment is flushed, a single, different thread will merge all TermsHashPerFields in FreqProxTermsWriter and then call shrinkHash(). I suspect this call of shrinkHash() is seeing an old postingsHash array, and subsequently not releasing all the memory that was allocated. > If this is the case, I am also concerned that FreqProxTermsWriter will not write the correct terms into the index, although I have not confirmed that any indexing problem occurs as of yet. > NOTE: i am witnessing this growth in a test by subtracting the amount or memory allocated (but in a "free" state) by perDocAllocator/byteBlockAllocator/charBlocks/intBlocks from DocumentsWriter.memUsage.get() in IndexWriter.doAfterFlush() > I will see this stay at a stable point for a while, then on some flushes, i will see this grow by a couple of bytes, and all subsequent flushes will never go back down the the previous state > I will continue to investigate and post any additional findings -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org