Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 75571 invoked from network); 26 Aug 2009 18:42:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Aug 2009 18:42:22 -0000 Received: (qmail 86372 invoked by uid 500); 26 Aug 2009 18:42:21 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 86243 invoked by uid 500); 26 Aug 2009 18:42:21 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 86234 invoked by uid 99); 26 Aug 2009 18:42:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Aug 2009 18:42:21 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Aug 2009 18:42:19 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 57A5E234C053 for ; Wed, 26 Aug 2009 11:41:59 -0700 (PDT) Message-ID: <1197011472.1251312119358.JavaMail.jira@brutus> Date: Wed, 26 Aug 2009 11:41:59 -0700 (PDT) From: "Robert Muir (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Commented: (LUCENE-1859) TermAttributeImpl's buffer will never "shrink" if it grows too big In-Reply-To: <64370193.1251293639298.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENE-1859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12748079#action_12748079 ] Robert Muir commented on LUCENE-1859: ------------------------------------- bq. If someone feeds a large text document with no spaces or other delimiting characters, a "non-intelligent" tokenizer would treat this a 1 big token (and grow the char[] accordingly) which non-intelligent tokenizers are you referring to? nearly all the lucene tokenizers have 255 as a limit. > TermAttributeImpl's buffer will never "shrink" if it grows too big > ------------------------------------------------------------------ > > Key: LUCENE-1859 > URL: https://issues.apache.org/jira/browse/LUCENE-1859 > Project: Lucene - Java > Issue Type: Bug > Components: Analysis > Affects Versions: 2.9 > Reporter: Tim Smith > Priority: Minor > > This was also an issue with Token previously as well > If a TermAttributeImpl is populated with a very long buffer, it will never be able to reclaim this memory > Obviously, it can be argued that Tokenizer's should never emit "large" tokens, however it seems that the TermAttributeImpl should have a reasonable static "MAX_BUFFER_SIZE" such that if the term buffer grows bigger than this, it will shrink back down to this size once the next token smaller than MAX_BUFFER_SIZE is set > I don't think i have actually encountered issues with this yet, however it seems like if you have multiple indexing threads, you could end up with a char[Integer.MAX_VALUE] per thread (in the very worst case scenario) > perhaps growTermBuffer should have the logic to shrink if the buffer is currently larger than MAX_BUFFER_SIZE and it needs less than MAX_BUFFER_SIZE -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org