code: @Override
  	public void lazyDestroy() {
  		// NOTE: if you change this logic, be sure to update recycle() as well!
  		synchronized (availableMemorySegments) {
  			if (!isDestroyed) {
  				MemorySegment segment;
  				while ((segment = availableMemorySegments.poll()) != null) {
  					returnMemorySegment(segment);
  				}
  
  				BufferListener listener;
  				while ((listener = registeredListeners.poll()) != null) {
  					listener.notifyBufferDestroyed();
  				}
  
  				isDestroyed = true;
  			}
  		}
  
  		try {
  			networkBufferPool.destroyBufferPool(this);
  		} catch (IOException e) {
  			ExceptionUtils.rethrow(e);
  		}
  	}
docs: Destroy is called after the produce or consume phase of a task finishes.