code: private long adjustItems(long size) {
  		while (size > maxSize && buffer.size() > 0) {
  			CBuffRecord old = buffer.removeFirst();
  			size -= old.bytes.length;
  		}
  		return size;
  	}
docs: /*
  Removes old records to satisfy buffer size limit.
  Note: This method should be called with the instance lock taken.
  
  @param size the current size of the buffer.
  @return the new size of the buffer after removal of records to satisfy the limit.