Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-4022

Offline Sorter wrongly uses MIN_BUFFER_SIZE if there is more memory available

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.6, 4.0-ALPHA
    • 4.0-ALPHA, 3.6.1
    • modules/spellchecker
    • None
    • New, Patch Available

    Description

      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:

      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));
      

      use use use Math.max instead of min here.

      Attachments

        1. LUCENE-4022.patch
          3 kB
          Simon Willnauer

        Activity

          People

            simonw Simon Willnauer
            simonw Simon Willnauer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: