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 1EAE498B3 for ; Thu, 26 Apr 2012 10:07:41 +0000 (UTC) Received: (qmail 7030 invoked by uid 500); 26 Apr 2012 10:07:39 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 6927 invoked by uid 500); 26 Apr 2012 10:07:39 -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 6918 invoked by uid 99); 26 Apr 2012 10:07:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Apr 2012 10:07:39 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Apr 2012 10:07:38 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 7CFC8410803 for ; Thu, 26 Apr 2012 10:07:18 +0000 (UTC) Date: Thu, 26 Apr 2012 10:07:18 +0000 (UTC) From: "Dawid Weiss (JIRA)" To: dev@lucene.apache.org Message-ID: <145437178.4692.1335434838568.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <624692917.4687.1335434477450.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (LUCENE-4022) Offline Sorter wrongly uses MIN_BUFFER_SIZE if there is more memory available 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-4022?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13262502#comment-13262502 ] Dawid Weiss commented on LUCENE-4022: ------------------------------------- It's a bug, don't know if it was a regression when we talked about how to estimate "half available heap" or if it was there even before then, but it should be Math.max(). Should we check for max array size overflows (for folks with super-large heaps)? > Offline Sorter wrongly uses MIN_BUFFER_SIZE if there is more memory available > ----------------------------------------------------------------------------- > > Key: LUCENE-4022 > URL: https://issues.apache.org/jira/browse/LUCENE-4022 > Project: Lucene - Java > Issue Type: Bug > Components: modules/spellchecker > Affects Versions: 3.6, 4.0 > Reporter: Simon Willnauer > Fix For: 4.0, 3.6.1 > > > The Sorter we use for offline sorting seems to use the MIN_BUFFER_SIZE as a upper bound even if there is more memory available. See this snippet: > {code} > long half = free/2; > if (half >= ABSOLUTE_MIN_SORT_BUFFER_SIZE) { > return new BufferSize(Math.min(MIN_BUFFER_SIZE_MB * MB, half)); > } > > // by max mem (heap will grow) > half = (max - total) / 2; > return new BufferSize(Math.min(MIN_BUFFER_SIZE_MB * MB, half)); > {code} > use use use Math.max instead of min here. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa 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