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

SparseFixedBitSet#or doesn't update memory accounting

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 8.11.2, 9.2
    • None
    • None
    • New

    Description

      While debugging why a cache was using way more memory than expected, one of my colleagues noticed that SparseFixedBitSet#or doesn't update ramBytesUsed. Here's a unit test that demonstrates this:

        public void testRamBytesUsed() throws IOException {
          BitSet bitSet = new SparseFixedBitSet(1000);
          long initialBytesUsed = bitSet.ramBytesUsed();
      
          DocIdSetIterator disi = DocIdSetIterator.all(1000);
          bitSet.or(disi);
          assertTrue(bitSet.ramBytesUsed() > initialBytesUsed);
        }
      

      It also looks like we don't have any tests for SparseFixedBitSet memory accounting (unless I've missed them!) It'd be nice to add more coverage there too.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              julietibs Julie Tibshirani
              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 - 50m
                  50m