code: @AfterBatch
    public void afterBatch()
    {
      if (_isGc) {
        return;
      }
      
      long gcSequence = _gcSequence;
      _gcSequence = 0;
      
      if (gcSequence <= 0) {
        return;
      }
      
      try {
        ArrayList<SegmentHeaderGc> collectList = findCollectList(gcSequence);
  
        if (collectList.size() < _table.database().getGcMinCollect()) {
          return;
        }
        
        _gcGeneration++;
  
        /*
        while (collectList.size() > 0) {
          ArrayList<SegmentHeaderGc> sublist = new ArrayList<>();
          
          // int sublen = Math.min(_db.getGcMinCollect(), collectList.size());
          
          int size = collectList.size();
          
          int sublen = size;
          
          if (size > 16) {
            sublen = Math.min(16, collectList.size() / 2);
          }
          
           // System.out.println("GC: count=" + sublen + " gcSeq=" + gcSequence);
            
            //if (_db.getGcMinCollect() <= sublist.size()) {
            //  sublen = Math.max(2, _db.getGcMinCollect() / 2);
            //}
          
          for (int i = 0; i < sublen; i++) {
            SegmentHeaderGc header = collectList.remove(0);
            header.startGc();
            sublist.add(header);
          }
          
          collect(gcSequence, sublist);
        }
        */
        collect(gcSequence, collectList);
      } catch (Throwable e) {
        e.printStackTrace();
      }
    }
docs: GC executes in @AfterBatch because it can be slower than the new
  requests under heavy load.