code: void recycleSegment(final CommitLogSegment segment)
      {
          boolean archiveSuccess = CommitLog.instance.archiver.maybeWaitForArchiving(segment.getName());
          activeSegments.remove(segment);
          if (!archiveSuccess)
          {
              // if archiving (command) was not successful then leave the file alone. don't delete or recycle.
              discardSegment(segment, false);
              return;
          }
          if (isCapExceeded())
          {
              discardSegment(segment, true);
              return;
          }
  
          logger.debug("Recycling {}", segment);
          segmentManagementTasks.add(new Callable<CommitLogSegment>()
          {
              public CommitLogSegment call()
              {
                  return segment.recycle();
              }
          });
      }
docs: Indicates that a segment is no longer in use and that it should be recycled.
  
  @param segment segment that is no longer in use