|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface LowMemoryListener
Listener interface for receiving and reacting to low memory events.
Note: It is important that implementors of this interface
implement LowMemoryListener.freeStaleObject(int)
properly. It should only return
true if it actually frees up an object of some kind.
LowMemoryFailedListener
,
LowMemoryManager
Field Summary | ||
---|---|---|
|
static int |
HIGH_PRIORITY
High priority low-memory requests. |
|
static int |
LOW_PRIORITY
Low priority low-memory requests. |
|
static int |
MEDIUM_PRIORITY
Medium priority low-memory requests. |
Method Summary | ||
---|---|---|
|
boolean |
freeStaleObject(int priority)
Called when the amount of available flash on the device has dropped below a safe level. |
Field Detail |
---|
static final int LOW_PRIORITY
In response to requests at LOW_PRIORITY, the listener should only free non-critical objects such as cached data.
static final int MEDIUM_PRIORITY
In response to requests at MEDIUM_PRIORITY
, the listener should free
objects that are stale, such as very old unfiled messages or old
calendar entries.
static final int HIGH_PRIORITY
In response to requests at HIGH_PRIORITY
, the listener should free
any objects that it considers to be stale in an effort to meet the
memory requirements.
Method Detail |
---|
boolean freeStaleObject(int priority)
In response to this call, the listener should attempt to free one
stale persistent object, and call
LowMemoryManager.markAsRecoverable(Object o)
to indicate to the
VM the amount of flash freed. Note that this is an "opt-in" system,
and therefore it is not guaranteed that a call to this method will result
in any flash memory being freed.
priority
- The priority level of the request. Listeners should use
this parameter to determine what types of objects should be freed. See
the priority level descriptions in this class for details.
True
if some persistent object was released, which indicates that
the LowMemoryManager
should feel free to call this method
again to free more data if necessary. Otherwise false
, which indicates
that no memory was freed and that the LowMemoryManager
should
not call this method again until an emergency garbage collection occurs.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.