lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dawid Weiss (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LUCENE-4022) Offline Sorter wrongly uses MIN_BUFFER_SIZE if there is more memory available
Date Thu, 26 Apr 2012 10:07:18 GMT

    [ 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


Mime
View raw message