SHOW Signed

net.rim.device.api.lowmemory
Interface LowMemoryListener


public interface LowMemoryListener

Listener interface for receiving and reacting to low memory events.

Note: It is important that implementors of this interface implement freeStaleObject(int) properly. It should only return true if it actually frees up an object of some kind.

Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

Since:
JDE 3.6.0
See Also:
LowMemoryFailedListener, LowMemoryManager

Field Summary
 Category: Signed static int HIGH_PRIORITY
          High priority low-memory requests.
 Category: Signed static int LOW_PRIORITY
          Low priority low-memory requests.
 Category: Signed static int MEDIUM_PRIORITY
          Medium priority low-memory requests.
 
Method Summary
 Category: Signed  boolean freeStaleObject(int priority)
          Called when the amount of available flash on the device has dropped below a safe level.
 

Field Detail

LOW_PRIORITY

public static final int LOW_PRIORITY
Low priority low-memory requests.

In response to requests at LOW_PRIORITY, the listener should only free non-critical objects such as cached data.

Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

MEDIUM_PRIORITY

public static final int MEDIUM_PRIORITY
Medium priority low-memory requests.

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.

Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

HIGH_PRIORITY

public static final int HIGH_PRIORITY
High priority low-memory requests.

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.

Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Method Detail

freeStaleObject

public boolean freeStaleObject(int priority)
Called when the amount of available flash on the device has dropped below a safe level.

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.

Parameters:
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).
Returns:
True if some persistent object was in fact released; otherwise, false.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.


Copyright 1999-2004 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.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.