Releases the table (the array of buckets) and returns the occupied memory segments to the list of free segments.
487395
protected void releaseTable() {
		// set the counters back
		this.numBuckets = 0;
		
		if (this.buckets != null) {
			for (int i = 0; i < this.buckets.length; i++) {
				this.availableMemory.add(this.buckets[i]);
			}
			this.buckets = null;
		}
	}
252162
public void close() {
		synchronized (this) {
			if (this.closed) {
				return;
			}
			this.closed = true;
		}
		
		this.numRecordsInBuffer = 0;
		this.numRecordsReturned = 0;
		
		// add the full segments to the empty ones
		for (int i = this.fullSegments.size() - 1; i >= 0; i--) {
			this.emptySegments.add(this.fullSegments.remove(i));
		}
		
		// release the memory segment
		this.memoryManager.release(this.emptySegments);
		this.emptySegments.clear();
		
		if (LOG.isDebugEnabled()) {
			LOG.debug("Block Resettable Iterator closed.");
		}
	}
1074194
public void free()
    {
        this.close();
        while (m_vTableList.size() > 0)
        {
            BaseTable table = m_vTableList.elementAt(0);
            table.free();
        } 
        m_vTableList.removeAllElements();
        m_vTableList = null;

        if (m_databaseOwner != null)
            m_databaseOwner.removeDatabase(this);
        m_databaseOwner = null;
        m_strDbName = null;
    }
468169
@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);
		}
	}
1050867
public void free()
    {
        super.free();
        try
        {
            if (this.getHandle(DBConstants.DATA_SOURCE_HANDLE) != null)
                ((BaseBuffer)this.getHandle(DBConstants.DATA_SOURCE_HANDLE)).free();
        } catch (DBException ex)    {
            // Never
        }
        if (m_pTable != null)
            m_pTable.removePTableOwner(this, true);      // Free or decrement the use count of the physical table
        m_pTable = null;
    }
1027445
public void releaseMemory()
    {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "releaseMemory");

        synchronized (this)
        {

            // v is unused
            //ArrayList v = new ArrayList();

            // Create a new stream to replace old one
            // as set latest ls prefix
            oststream = new StateStream();
            oststream.init();
            oststream.setCompletedPrefix(oack);

        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "releaseMemory");
    }
1087449
private final void releaseDTMXRTreeFrags(){
    if(m_DTMXRTreeFrags == null){
      return;
    }
    final Iterator iter = (m_DTMXRTreeFrags.values()).iterator();
    while(iter.hasNext()){
      DTMXRTreeFrag frag = (DTMXRTreeFrag)iter.next();
      frag.destruct();
      iter.remove();
    }
    m_DTMXRTreeFrags = null;
 }
1251402
private void freeCompactedSegments() {
        SegmentManager segManager = _dataArray.getSegmentManager();
        if(segManager == null) return;
        
        while(!_freeQueue.isEmpty()) {
            Segment seg = _freeQueue.remove();
            try {
                segManager.freeSegment(seg);
            } catch(Exception e) {
                _log.error("failed to free Segment " + seg.getSegmentId() + ": " + seg.getStatus(), e);
            }
        }
    }
576358
public void clear()
    {
        // clear out ref queue. We don't need to expunge entries
        // since gc'ed entries won't get copied.
        emptyReferenceQueue();

        for (int i = 0; i < table.length; i++)
        {
            Entry e = table[i];
            Entry first = null;
            Entry prev = null;
            while (e != null)
            {
                Object candidate = e.get();
                if (candidate != null)
                {
                    Entry dirty = e.makeDirtyAndWeak(queue);
                    if (first == null)
                    {
                        first = dirty;
                    }
                    if (prev != null)
                    {
                        prev.setNext(dirty);
                    }
                    prev = dirty;
                }
                else
                {
                    if (prev != null)
                    {
                        prev.setNext(e.getState().next);
                    }
                    size--;
                }
                e = e.getState().next;
            }
            table[i] = first;
        }

        // Allocation of array may have caused GC, which may have caused
        // additional entries to go stale.  Removing these entries from the
        // reference queue will make them eligible for reclamation.
        expungeStaleEntries();
    }
1167752
@Override
	public void releaseMemory(int toRelease) throws IOException {
		checkArgument(toRelease > 0);

		for (ResultSubpartition subpartition : subpartitions) {
			toRelease -= subpartition.releaseMemory();

			// Only release as much memory as needed
			if (toRelease <= 0) {
				break;
			}
		}
	}
1109851
@Override
    public void free(AllocationPoint point, AllocationStatus target) {
        //if (point.getAllocationStatus() == AllocationStatus.DEVICE)
        //deviceAllocations.get(point.getDeviceId()).remove(point.getObjectId());

        //zeroAllocations.get(point.getBucketId()).remove(point.getObjectId());
        if (point.getAllocationStatus() == AllocationStatus.DEVICE)
            deviceMemoryTracker.subFromAllocation(Thread.currentThread().getId(), point.getDeviceId(),
                            AllocationUtils.getRequiredMemory(point.getShape()));

        memoryProvider.free(point);
    }
959378
public void clear() {         // Smack a new empty table down
    CHM newchm = new CHM(this,new ConcurrentAutoTable(),MIN_SIZE_LOG);
    while( !CAS(_chm_offset,_chm,newchm) ) // Spin until the clear works
      ;
    CAS(_val_1_offset,_val_1,TOMBSTONE);
  }
1131303
public void clear() {
	new ByteArrayList(this.state).fillFromToWith(0, this.state.length-1, FREE);
   	new ObjectArrayList(values).fillFromToWith(0, state.length-1, null); // delta

	this.distinct = 0;
	this.freeEntries = table.length; // delta
	trimToSize();
}
865648
public void clear() {
		this.hashSize = this.startHashSize;
		this.numTables = this.startNumTables;
		this.numElements = 0;

		this.hashfunctions.clear();
		this.tables.clear();
		int sizeTables = 1 << this.startHashSize;
		for (int i = 0; i < this.startNumTables; i++) {
			this.hashfunctions.add(new DietzfelbingerHash(this.startHashSize,
					this.random));
			List<Entry<T>> table = new ArrayList<Entry<T>>(sizeTables);
			for (int j = 0; j < sizeTables; j++) {
				table.add(null);
			}
			this.tables.add(table);
		}

		this.stash.clear();
		this.stashSize = 0;
	}
166434
public void drain() {
		synchronized (list) {
			for (int i = 0; i < list.size(); ++i) {
				Pooled<T> pt = list.remove();
				creator.destroy(pt.content);
				pt.logTarget.log("Pool drained ", creator.toString());
			}
			count = spares = 0;
		}

	}
789399
private synchronized void expungeStaleEntries()
    {
        if (size == 0) return;
        Object r;
        while ((r = queue.poll()) != null)
        {
            Entry e = (Entry) r;
            unlink(e);
            int h = e.hash;
            int i = indexFor(h, table.length);

            Entry prev = table[i];
            Entry p = prev;
            while (p != null)
            {
                Entry next = p.next;
                if (p == e)
                {
                    if (prev == e)
                        table[i] = next;
                    else
                        prev.next = next;
                    e.next = null;  // Help GC
                    size--;
                    break;
                }
                prev = p;
                p = next;
            }
        }
    }
655597
public void free()
    {
        this.setCacheMinutes(0);    // Turn off the cache
        Object[] keys = m_htDBList.keySet().toArray();
        for (int i = 0; i < keys.length; i++)
        { 
            Object key = keys[i];
            PDatabase pDatabase = (PDatabase)m_htDBList.get(key);
            pDatabase.free();
        } 
        m_htDBList.clear();
        m_htDBList = null;
    }