src/org/jnetpcap/nio/DisposableGC.java
public void drainRefQueue(long timeout) throws IllegalArgumentException,
			InterruptedException {

		memorySemaphore.acquire(memorySemaphore.availablePermits()); // Grab all
		// of
		// them

		/*
		 * Breakup the timeout into 100 partitions so that we can check the permits
		 * more often then just a single monolithic times.
		 */
		long partition = timeout / 100;
		while (memorySemaphore.availablePermits() < MIN_MEMORY_RELEASE) {
			DisposableReference ref = (DisposableReference) refQueue.remove(timeout);

			if (ref == null && partition++ < 100) {
				continue;
			}

			if (ref == null) {
				break;
			}

			dispose(ref);
		}
	}
/**
	 * Drain ref queue.
	 * 
	 * @param timeout
	 *          the timeout
	 * @throws IllegalArgumentException
	 *           the illegal argument exception
	 * @throws InterruptedException
	 *           the interrupted exception
	 */
Drain ref queue.

@param timeout
the timeout
@throws IllegalArgumentException
the illegal argument exception
@throws InterruptedException
the interrupted exception
Drain ref queue . @param timeout the timeout @throws IllegalArgumentException the illegal argument exception @throws InterruptedException the interrupted exception
public void drainRefQueue(long timeout) throws IllegalArgumentException,
			InterruptedException {
		memorySemaphore.acquire(memorySemaphore.availablePermits()); 
		/*
		 * Breakup the timeout into 100 partitions so that we can check the permits
		 * more often then just a single monolithic times.
		 */
		long partition = timeout / 100;
		while (memorySemaphore.availablePermits() < MIN_MEMORY_RELEASE) {
			DisposableReference ref = (DisposableReference) refQueue.remove(timeout);
			if (ref == null && partition++ < 100) {
				continue;
			}
			if (ref == null) {
				break;
			}
			dispose(ref);
		}
	}
public void drainRefQueue ( long timeout ) throws IllegalArgumentException , InterruptedException { memorySemaphore . acquire ( memorySemaphore . availablePermits ( ) ) ; /*
		 * Breakup the timeout into 100 partitions so that we can check the permits
		 * more often then just a single monolithic times.
		 */ long partition = timeout / 100 ; while ( memorySemaphore . availablePermits ( ) < MIN_MEMORY_RELEASE ) { DisposableReference ref = ( DisposableReference ) refQueue . remove ( timeout ) ; if ( ref == null && partition ++ < 100 ) { continue ; } if ( ref == null ) { break ; } dispose ( ref ) ; } }
Drain ref queue.
Drain ref queue .
// Grab all // of // them