Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-17036

Lazy create VersionBucket in the update log to free memory.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 9.5
    • None
    • None

    Description

      Each time an UpdateLog is created for a SolrCore, its VersionInfo creates a large array of 65536 VersionBucket. This takes 1.5 MB in memory even for an empty core (computed with RamUsageEstimator). So when the number of core increases, this memory starts to weight.

      We propose to modify VersionInfo to not create the large array of VersionBucket at initialization. Instead start with a hash map, and replace it by the array if it grows beyond the threshold. In addition, BucketVersion instances are created lazily.

      As a result

      • Empty cores require much less memory.
      • Cores with no update will not fill the map.
      • Cores with less updates before they are closed will stay with a small sized map.

      Attachments

        Issue Links

          Activity

            People

              broustant Bruno Roustant
              broustant Bruno Roustant
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 4h 20m
                  4h 20m