Clean the references that was released.

<p>Notifies the listeners if a reference was released.

@return the size
429456
@SuppressWarnings("unchecked")
	public int expurge() {
		// clear out ref queue.
		while (this.queue.poll() != null) {
			this.enquedElement = true;
		}

		int j;

		if (this.enquedElement) {
			// Clear the table
			Reference<? extends T> ref;
			j = 0;
			for (int i = 0; i < this.size; ++i) {
				ref = (Reference<T>) this.data[i];
				if ((ref == null) || (ref.isEnqueued()) || (ref.get() == null)) {
					if (ref != null) {
						ref.clear();
					}
					this.data[i] = null;
				} else {
					if (i != j) {
						this.data[j] = this.data[i];
						this.data[i] = null;
					}
					j++;
				}
			}
			this.enquedElement = false;
		} else {
			j = this.size;
		}

		// 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.
		while (this.queue.poll() != null) {
			this.enquedElement = true;
		}

		final int oldSize = this.size;
		this.size = j;

		if (j < oldSize) {
			fireReferenceRelease(oldSize - j);
		}

		return this.size;
	}
428083
@Override
    public long getTotalSize() {
        if (totalSize == HasTotalSize.NOT_DEPLETED && !hasNext()) {
            totalSize = hasTotalSize == null ? HasTotalSize.NOT_DEPLETED : hasTotalSize.getTotalSize();
        }
        return totalSize;
    }
101667
@Override
    public int size() {
        registryLock.readLock().lock();
        try {
            return entryMap.size();
        } finally {
            registryLock.readLock().unlock();
        }
    }
579983
public boolean decrement() {
		synchronized (lock) {
			if (isDisposed) {
				return false;
			}

			referenceCount--;

			if (referenceCount <= disposeOnReferenceCount) {
				isDisposed = true;
			}

			return isDisposed;
		}
	}
788278
public int size() {
		int size = 0;
		for (List<V> value : map.values()) {
			size += value.size();
		}
		return size;
	}
778091
public E removeLast () {
		if (size > 0) {
			E e = data[--size];
			data[size] = null;
			return e;
		}

		return null;
	}
1072766
def clean
      if @dirty
        @store = FFI::MemoryPointer.new @element_size, @items.size, true

        # copy over
        offset = 0
        @items.each do |item|
          LibC.memcpy(@store + offset, item.pointer, @element_size)
          offset += @element_size
        end

        @dirty = false
      end
    end
514929
public long totalSize() {
        long retval=0;
        for(int i=0; i < index; i++)
            retval+=total_size_visitor.applyAsLong(messages[i], this);
        return retval;
    }
1250830
public int size() {
        int retval=0;
        for(int i=0; i < index; i++)
            if(messages[i] != null)
                retval++;
        return retval;
    }
347034
public List<ByteBuffer> releaseRemaining() {
        List<ByteBuffer> ret = buffers;
        buffers = null;
        return ret;
    }
281681
public int freeMemory() {
        int size = 0;
        for (int m = 0; m < memory.length; m++) {
            size += memory[m].length;
            memory[m] = null;
        }
        memory = null;
        return size;
    }
1047242
public void deleteReference() {
    if (decreaseRefCount() == 0) {
      T deleted;
      synchronized (this) {
        deleted = mValue;
        mValue = null;
      }
      mResourceReleaser.release(deleted);
      removeLiveReference(deleted);
    }
  }
64755
public int size() {
		int size = 0;
		for (SourceFolder sourceFolder : this.sourceFolders.values()) {
			size += sourceFolder.getFiles().size();
		}
		return size;
	}
1026673
public long size() {
    long res = 0;
    if (_network!=null) res+=_network.length;
    if (_modelparams!=null) res+=_modelparams.length;
    return res;
  }
109436
public Map<Object, String> getTrimToSize() {

        if (m_trimToSize == null) {
            m_trimToSize = CmsCollectionsGenericWrapper.createLazyMap(new CmsTrimToSizeTransformer());
        }
        return m_trimToSize;
    }
297604
public StreamCutReferenceRecord findStreamCutReferenceForSize(long size) {
        int beforeIndex = getGreatestLowerBound(this, size, StreamCutReferenceRecord::getRecordingSize);
        if (beforeIndex < 0) {
            return null;
        }

        return retentionRecords.get(beforeIndex);
    }
712050
private void clean() {
        Iterator<Entry<K, WeakReference<V>>> iter = entrySet().iterator();
        while (iter.hasNext()) {
            Entry<K, WeakReference<V>> e = iter.next();
            if (e != null && e.getValue() != null
                && e.getValue().get() == null) {
                iter.remove();
            }
        }
    }