Java in a Nutshell, 5th Edition [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Java in a Nutshell, 5th Edition [Electronic resources] - نسخه متنی

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید




This class represents a soft reference
to an object. A SoftReference is not cleared while
there are any remaining hard (direct) references to the referent.
Once the referent is no longer in use (i.e., there are no remaining
hard references to it), the garbage collector may clear the
SoftReference to the referent at any time.
However, the garbage collector does not clear a
SoftReference until it determines that system
memory is running low. In particular, the Java VM never throws an
OutOfMemoryError without first clearing all soft
references and reclaiming the memory of the referents. The VM may
(but is not required to) clear soft references according to a
least-recently-used ordering.

If a SoftReference has an associated
ReferenceQueue, the garbage collector enqueues the
SoftReference at some time after it clears the
reference.

SoftReference is particularly useful for
implementing object-caching systems that do not have a fixed size,
but grow and shrink as available memory allows.


Figure 10-89. java.lang.ref.SoftReference<T>

public class 

SoftReference<T> extends Reference<T> {
// Public Constructors
public

SoftReference (T

referent );
public

SoftReference (T

referent , ReferenceQueue<? super T>

q );
// Public Methods Overriding Reference
public T

get ( );
}



/ 1191