Simon Willnauer created LUCENE-4022:
---------------------------------------

             Summary: 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to