test_class.declarator: stats = newHashMap()
test_class.modifier: private final
test_class.original_string: private final Map<String, CounterStats> stats = newHashMap();
test_class.type: Map<String, CounterStats>
test_class.var_name: stats
test_class.declarator: segmentBufferMonitor = new SegmentBufferMonitor(new StatisticsProvider() {
          @Override
          public RepositoryStatistics getStats() {
              throw new IllegalStateException();
          }
  
          @Override
          public MeterStats getMeter(String name, StatsOptions options) {
              throw new IllegalStateException();
          }
  
          @Override
          public CounterStats getCounterStats(String name, StatsOptions options) {
              SimpleStats simpleStats = new SimpleStats(new AtomicLong(), COUNTER);
              stats.put(name, simpleStats);
              return simpleStats;
          }
  
          @Override
          public TimerStats getTimer(String name, StatsOptions options) {
              throw new IllegalStateException();
          }
  
          @Override
          public HistogramStats getHistogram(String name, StatsOptions options) {
              throw new IllegalStateException();
          }
      })
test_class.modifier: private final
test_class.original_string: private final SegmentBufferMonitor segmentBufferMonitor = new SegmentBufferMonitor(new StatisticsProvider() {
          @Override
          public RepositoryStatistics getStats() {
              throw new IllegalStateException();
          }
  
          @Override
          public MeterStats getMeter(String name, StatsOptions options) {
              throw new IllegalStateException();
          }
  
          @Override
          public CounterStats getCounterStats(String name, StatsOptions options) {
              SimpleStats simpleStats = new SimpleStats(new AtomicLong(), COUNTER);
              stats.put(name, simpleStats);
              return simpleStats;
          }
  
          @Override
          public TimerStats getTimer(String name, StatsOptions options) {
              throw new IllegalStateException();
          }
  
          @Override
          public HistogramStats getHistogram(String name, StatsOptions options) {
              throw new IllegalStateException();
          }
      });
test_class.type: SegmentBufferMonitor
test_class.var_name: segmentBufferMonitor
test_class.file: oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/SegmentBufferMonitorTest.java
test_class.identifier: SegmentBufferMonitorTest
test_case.body: @Test
      public void heapBuffer() {
          Buffer buffer = Buffer.allocate(42);
          segmentBufferMonitor.trackAllocation(buffer);
  
          assertEquals(0, stats.get(DIRECT_BUFFER_COUNT).getCount());
          assertEquals(0, stats.get(DIRECT_BUFFER_CAPACITY).getCount());
          assertEquals(1, stats.get(HEAP_BUFFER_COUNT).getCount());
          assertEquals(42, stats.get(HEAP_BUFFER_CAPACITY).getCount());
  
          buffer = null;
          System.gc();
  
          assertEquals(0, stats.get(DIRECT_BUFFER_COUNT).getCount());
          assertEquals(0, stats.get(DIRECT_BUFFER_CAPACITY).getCount());
          assertTrue(stats.get(HEAP_BUFFER_COUNT).getCount() <= 1);
          assertTrue(stats.get(HEAP_BUFFER_CAPACITY).getCount() <= 42);
      }
test_case.class_method_signature: SegmentBufferMonitorTest.heapBuffer()
test_case.full_signature: @Test public void heapBuffer()
test_case.identifier: heapBuffer
test_case.invocations: allocate trackAllocation assertEquals getCount get assertEquals getCount get assertEquals getCount get assertEquals getCount get gc assertEquals getCount get assertEquals getCount get assertTrue getCount get assertTrue getCount get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void heapBuffer()
focal_class.declarator: DIRECT_BUFFER_COUNT = "oak.segment.direct-buffer-count"
focal_class.modifier: public static final
focal_class.original_string: public static final String DIRECT_BUFFER_COUNT = "oak.segment.direct-buffer-count";
focal_class.type: String
focal_class.var_name: DIRECT_BUFFER_COUNT
focal_class.declarator: DIRECT_BUFFER_CAPACITY = "oak.segment.direct-buffer-capacity"
focal_class.modifier: public static final
focal_class.original_string: public static final String DIRECT_BUFFER_CAPACITY = "oak.segment.direct-buffer-capacity";
focal_class.type: String
focal_class.var_name: DIRECT_BUFFER_CAPACITY
focal_class.declarator: HEAP_BUFFER_COUNT = "oak.segment.heap-buffer-count"
focal_class.modifier: public static final
focal_class.original_string: public static final String HEAP_BUFFER_COUNT = "oak.segment.heap-buffer-count";
focal_class.type: String
focal_class.var_name: HEAP_BUFFER_COUNT
focal_class.declarator: HEAP_BUFFER_CAPACITY = "oak.segment.heap-buffer-capacity"
focal_class.modifier: public static final
focal_class.original_string: public static final String HEAP_BUFFER_CAPACITY = "oak.segment.heap-buffer-capacity";
focal_class.type: String
focal_class.var_name: HEAP_BUFFER_CAPACITY
focal_class.declarator: buffers = newConcurrentHashSet()
focal_class.modifier: @NotNull
      private final
focal_class.original_string: @NotNull
      private final Set<BufferReference> buffers = newConcurrentHashSet();
focal_class.type: Set<BufferReference>
focal_class.var_name: buffers
focal_class.declarator: referenceQueue = new ReferenceQueue<>()
focal_class.modifier: @NotNull
      private final
focal_class.original_string: @NotNull
      private final ReferenceQueue<Buffer> referenceQueue = new ReferenceQueue<>();
focal_class.type: ReferenceQueue<Buffer>
focal_class.var_name: referenceQueue
focal_class.declarator: directBufferCount
focal_class.modifier: @NotNull
      private final
focal_class.original_string: @NotNull
      private final CounterStats directBufferCount;
focal_class.type: CounterStats
focal_class.var_name: directBufferCount
focal_class.declarator: directBufferCapacity
focal_class.modifier: @NotNull
      private final
focal_class.original_string: @NotNull
      private final CounterStats directBufferCapacity;
focal_class.type: CounterStats
focal_class.var_name: directBufferCapacity
focal_class.declarator: heapBufferCount
focal_class.modifier: @NotNull
      private final
focal_class.original_string: @NotNull
      private final CounterStats heapBufferCount;
focal_class.type: CounterStats
focal_class.var_name: heapBufferCount
focal_class.declarator: heapBufferCapacity
focal_class.modifier: @NotNull
      private final
focal_class.original_string: @NotNull
      private final CounterStats heapBufferCapacity;
focal_class.type: CounterStats
focal_class.var_name: heapBufferCapacity
focal_class.file: oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentBufferMonitor.java
focal_class.identifier: SegmentBufferMonitor
focal_class.class_method_signature: SegmentBufferMonitor.SegmentBufferMonitor(@NotNull StatisticsProvider statisticsProvider)
focal_class.full_signature: public  SegmentBufferMonitor(@NotNull StatisticsProvider statisticsProvider)
focal_class.identifier: SegmentBufferMonitor
focal_class.modifiers: public
focal_class.parameters: (@NotNull StatisticsProvider statisticsProvider)
focal_class.signature:  SegmentBufferMonitor(@NotNull StatisticsProvider statisticsProvider)
focal_class.class_method_signature: SegmentBufferMonitor.trackAllocation(@NotNull Buffer buffer)
focal_class.full_signature: public void trackAllocation(@NotNull Buffer buffer)
focal_class.identifier: trackAllocation
focal_class.modifiers: public
focal_class.parameters: (@NotNull Buffer buffer)
focal_class.return: void
focal_class.signature: void trackAllocation(@NotNull Buffer buffer)
focal_class.class_method_signature: SegmentBufferMonitor.trackDeallocations()
focal_class.full_signature: private void trackDeallocations()
focal_class.identifier: trackDeallocations
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void trackDeallocations()
focal_class.class_method_signature: SegmentBufferMonitor.allocated(@NotNull BufferReference reference)
focal_class.full_signature: private void allocated(@NotNull BufferReference reference)
focal_class.identifier: allocated
focal_class.modifiers: private
focal_class.parameters: (@NotNull BufferReference reference)
focal_class.return: void
focal_class.signature: void allocated(@NotNull BufferReference reference)
focal_class.class_method_signature: SegmentBufferMonitor.deallocated(@NotNull BufferReference reference)
focal_class.full_signature: private void deallocated(@NotNull BufferReference reference)
focal_class.identifier: deallocated
focal_class.modifiers: private
focal_class.parameters: (@NotNull BufferReference reference)
focal_class.return: void
focal_class.signature: void deallocated(@NotNull BufferReference reference)
focal_method.body: public void trackAllocation(@NotNull Buffer buffer) {
          BufferReference reference = new BufferReference(buffer, referenceQueue);
          buffers.add(reference);
          allocated(reference);
          trackDeallocations();
      }
focal_method.class_method_signature: SegmentBufferMonitor.trackAllocation(@NotNull Buffer buffer)
focal_method.full_signature: public void trackAllocation(@NotNull Buffer buffer)
focal_method.identifier: trackAllocation
focal_method.invocations: add allocated trackDeallocations
focal_method.modifiers: public
focal_method.parameters: (@NotNull Buffer buffer)
focal_method.return: void
focal_method.signature: void trackAllocation(@NotNull Buffer buffer)