Drains the weak / soft value references queue.
765788
@GuardedBy("evictionLock")
  void drainValueReferences() {
    if (!collectValues()) {
      return;
    }
    Reference<? extends V> valueRef;
    while ((valueRef = valueReferenceQueue().poll()) != null) {
      @SuppressWarnings("unchecked")
      InternalReference<V> ref = (InternalReference<V>) valueRef;
      Node<K, V> node = data.get(ref.getKeyReference());
      if ((node != null) && (valueRef == node.getValueReference())) {
        evictEntry(node, RemovalCause.COLLECTED, 0L);
      }
    }
  }
657003
private void cleanUpSource() {
		SoundStore store = SoundStore.get();
		
		AL10.alSourceStop(store.getSource(0));
		IntBuffer buffer = BufferUtils.createIntBuffer(1);
		int queued = AL10.alGetSourcei(store.getSource(0), AL10.AL_BUFFERS_QUEUED);
		
		while (queued > 0)
		{
			AL10.alSourceUnqueueBuffers(store.getSource(0), buffer);
			queued--;
		}
		
		AL10.alSourcei(store.getSource(0), AL10.AL_BUFFER, 0);
	}
913891
public final void garbageCollect() {
    if (timeout != null && !data.isEmpty()) {
      long boundaryTime = System.currentTimeMillis() - (garbageTimeout);
      data.removeIf((MtasSolrStatus solrStatus) -> solrStatus.finished() || solrStatus.getStartTime() < boundaryTime);
      index.clear();
      data.forEach((MtasSolrStatus solrStatus) -> index.put(solrStatus.key(), solrStatus));
    }
  }
691757
private void dropCaches(final TSDB tsdb, final Channel chan) {
        LOG.warn(chan + " Dropping all in-memory caches.");
        tsdb.dropCaches();
    }
1127601
public void freeCurrent() {
		int beforeReleaseNum = availableMemory.size();
		memManager.release(availableMemory);
		allocatedFloatingNum -= (beforeReleaseNum - availableMemory.size());
	}
1306282
protected void drain() {
        Message msg;
        while((msg=queue.poll()) != null)
            addAndSendIfSizeExceeded(msg);
        _sendBundledMessages();
    }
1131520
private void _processQueue ()
  {
    SoftValue <K, V> aSoftValue;
    while ((aSoftValue = GenericReflection.uncheckedCast (m_aQueue.poll ())) != null)
    {
      m_aSrcMap.remove (aSoftValue.m_aKey);
    }
  }
209432
public void clearDereferencedListeners() {
        if (uiThreadRunner.isOnUiThread()) {
            graph.clearDereferencedListeners();
        } else {
            uiThreadRunner.post(new Runnable() {
                @Override
                public void run() {
                    graph.clearDereferencedListeners();
                }
            });
        }
    }
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;
		}

	}
37728
private static void releaseReferences() {
		synchronized(versionedEcodDBs) {
			Iterator<Entry<String, SoftReference<EcodDatabase>>> it = versionedEcodDBs.entrySet().iterator();
			while(it.hasNext()) {
				Entry<String, SoftReference<EcodDatabase>> entry = it.next();
				SoftReference<EcodDatabase> ref = entry.getValue();
				if(ref.get() == null) {
					logger.debug("Removed version {} from EcodFactory to save memory.",entry.getKey());
					it.remove();
				}
			}
		}
	}
610635
public void flush() {
        top = null;
        defaultEntry.reset(0);
        first.reset(minQueueLength);

        for (int i = memregs.length - 1; i > 0; i--) {
            MemReg mr = memregs[i];
            mr.in = mr.out = -1;
        }
        /*
        for (int i = memregs.length - 1; i > 0; i--) {
            MemReg mr = memregs[i];
            mr.in = mr.out = -1;
        }*/
        called = false;
    }
927135
public <T extends CacheSpec<K, V>> T weakValues() {
      this.weakValues = true;
      return Cast.as(this);
   }
1246458
def _cleanup_factory(self):
        """"""
        _self = weakref.proxy(self)
        def wrapper():
            try:
                _self.close(timeout=0)
            except (ReferenceError, AttributeError):
                pass
        return wrapper
1055488
protected void drain() throws IOException {
        if (primitiveTypes == null || primitiveTypesBuffer == null) {
            return;
        }

        // If we got here we have a Stream previously created
        int offset = 0;
        byte[] written = primitiveTypesBuffer.toByteArray();
        // Normalize the primitive data
        while (offset < written.length) {
            int toWrite = written.length - offset > 1024 ? 1024
                    : written.length - offset;
            if (toWrite < 256) {
                output.writeByte(TC_BLOCKDATA);
                output.writeByte((byte) toWrite);
            } else {
                output.writeByte(TC_BLOCKDATALONG);
                output.writeInt(toWrite);
            }

            // write primitive types we had and the marker of end-of-buffer
            output.write(written, offset, toWrite);
            offset += toWrite;
        }

        // and now we're clean to a state where we can write an object
        primitiveTypes = null;
        primitiveTypesBuffer = null;
    }
1144708
public void drainAndHalt()
    {
        Sequence[] workerSequences = getWorkerSequences();
        while (ringBuffer.getCursor() > Util.getMinimumSequence(workerSequences))
        {
            Thread.yield();
        }

        for (WorkProcessor<?> processor : workProcessors)
        {
            processor.halt();
        }

        started.set(false);
    }
442716
public <T> void cleanNullReferences(Class<T> clazz) {
		Map<Object, Reference<Object>> objectMap = getMapForClass(clazz);
		if (objectMap != null) {
			cleanMap(objectMap);
		}
	}
343470
public void purge()
    {
        WeakElement<?>    element;

        while( ( element = (WeakElement<?>) _queue.poll() ) != null )
        {
            _set.remove( element );
        }
    }