code: public int finalizeProbePhase(List<MemorySegment> freeMemory, List<HashPartition<BT, PT>> spilledPartitions)
  	throws IOException
  	{
  		if (isInMemory()) {
  			// in this case, return all memory buffers
  			
  			// return the overflow segments
  			for (int k = 0; k < this.numOverflowSegments; k++) {
  				freeMemory.add(this.overflowSegments[k]);
  			}
  			this.overflowSegments = null;
  			this.numOverflowSegments = 0;
  			this.nextOverflowBucket = 0;
  			// return the partition buffers
  			for (int i = 0; i < this.partitionBuffers.length; i++) {
  				freeMemory.add(this.partitionBuffers[i]);
  			}
  			this.partitionBuffers = null;
  			return 0;
  		}
  		else if (this.probeSideRecordCounter == 0) { 
  			// partition is empty, no spilled buffers
  			// return the memory buffer
  			freeMemory.add(this.probeSideBuffer.getCurrentSegment());
  			
  			// delete the spill files
  			this.probeSideChannel.close();
  			this.buildSideChannel.deleteChannel();
  			this.probeSideChannel.deleteChannel();
  			
  			return 0;
  		}
  		else {
  			// flush the last probe side buffer and register this partition as pending
  			this.probeSideBuffer.close();
  			this.probeSideChannel.close();
  			spilledPartitions.add(this);
  			return 1;
  		}
  	}
docs: @param freeMemory
  @param spilledPartitions
  @return The number of write-behind buffers reclaimable after this method call.
  
  @throws IOException