Package | Description |
---|---|
java.lang.ref |
Provides reference-object classes, which support a limited degree of
interaction with the garbage collector.
|
Modifier and Type | Class and Description |
---|---|
class |
PhantomReference<T>
PhantomReference objects are used to detect referents which
are no longer visible and are eligible to have their storage
reclaimed.
|
class |
SoftReference<T>
SoftReference objects are used to detect referents which
are no longer visible and who's memory is to be reclaimed.
|
class |
WeakReference<T>
WeakReference objects are used to detect referents which
are no longer visible.
|
Modifier and Type | Method and Description |
---|---|
Reference<? extends T> |
ReferenceQueue.poll()
Returns the next available reference from the queue
if one is enqueued, null otherwise.
|
Reference<? extends T> |
ReferenceQueue.remove()
Return the next available enqueued reference on the queue, blocking
indefinitely until one is available.
|
Reference<? extends T> |
ReferenceQueue.remove(long timeout)
Return the next available enqueued reference on the queue, blocking
up to the time given until one is available.
|
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.