docs: private void truncateFile(List<FileEntry> entries) {
        long startTime = 0;
        if (trace) startTime = timeService.wallClockTime();
  
        int reclaimedSpace = 0;
        int removedEntries = 0;
        long truncateOffset = -1;
        for (Iterator<FileEntry> it = entries.iterator() ; it.hasNext(); ) {
           FileEntry fe = it.next();
           // Till we have free entries at the end of the file,
           // we can remove them and contract the file to release disk
           // space.
           if (!fe.isLocked() && ((fe.offset + fe.size) == filePos)) {
              truncateOffset = fe.offset;
              filePos = fe.offset;
              freeList.remove(fe);
              it.remove();
              reclaimedSpace += fe.size;
              removedEntries++;
           } else {
              break;
           }
        }
  
        if (truncateOffset > 0) {
           try {
              channel.truncate(truncateOffset);
           } catch (IOException e) {
              throw new PersistenceException("Error while truncating file", e);
           }
        }
  
        if (trace) {
           log.tracef("Removed entries: %d, Reclaimed Space: %d, Free Entries %d", removedEntries, reclaimedSpace, freeList.size());
           log.tracef("Time taken for truncateFile: %d (ms)", timeService.wallClockTime() - startTime);
        }
     }