net.rim.device.api.lowmemory
Class LowMemoryManager

java.lang.Object
  extended by net.rim.device.api.lowmemory.LowMemoryManager

public abstract class LowMemoryManager
extends Object

The LowMemoryManager maintains memory resources on the device when the device becomes over-taxed and runs low on memory. When the device becomes low on memory, the LowMemoryManager frees up memory resources by prioritizing objects in memory, and marking objects it deems less critical for deletion by the VM. Old mail messages, and calendar entries are typically deleted first.

The LowMemoryListener class receives and reacts to LowMemoryManager events, while the LowMemoryFailedManager class reports LowMemoryManager failures.

See Also:
LowMemoryListener, LowMemoryFailedListener
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

Field Summary
Category: Signed static long GUID_FLASH_LOW
          The GUID of the global event, posted by the system, to notify the LowMemoryManager that the system is low on memory.
 
Constructor Summary
Category: Signed protected LowMemoryManager()
          Creates a new LowMemoryManager instance.
 
Method Summary
Category: Signed static void addLowMemoryFailedListener(LowMemoryFailedListener listener)
          Adds a LowMemoryFailedListener.
Category: Signed static void addLowMemoryListener(LowMemoryListener listener)
          Adds a LowMemoryListener.
Category: Signed static void markAsRecoverable(Object o)
          Marks stale objects in memory for deletion by the VM.
Category: Signed static void poll()
          Calls the LowMemoryManager and tells it to poll device memory levels.
Category: Signed static void removeLowMemoryFailedListener(LowMemoryFailedListener listener)
          Removes a LowMemoryFailedListener
Category: Signed static void removeLowMemoryListener(LowMemoryListener listener)
          Removes a LowMemoryListener.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Field Detail

GUID_FLASH_LOW

public static final long GUID_FLASH_LOW
The GUID of the global event, posted by the system, to notify the LowMemoryManager that the system is low on memory.

See Also:
Constant Field Values
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2


Constructor Detail

LowMemoryManager

protected LowMemoryManager()
Creates a new LowMemoryManager instance.

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0


Method Detail

addLowMemoryFailedListener

public static void addLowMemoryFailedListener(LowMemoryFailedListener listener)
Adds a LowMemoryFailedListener.

The LowMemoryFailedListener listens for failed LowMemoryManager operations.

Parameters:
listener - The LowMemoryFailedListener to add.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

addLowMemoryListener

public static void addLowMemoryListener(LowMemoryListener listener)
Adds a LowMemoryListener.

The LowMemoryListener listens for and reacts to LowMemoryManager operations.

Parameters:
listener - The LowMemoryListener to add.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

removeLowMemoryListener

public static void removeLowMemoryListener(LowMemoryListener listener)
Removes a LowMemoryListener.

Parameters:
listener - The LowMemoryListener to remove.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

removeLowMemoryFailedListener

public static void removeLowMemoryFailedListener(LowMemoryFailedListener listener)
Removes a LowMemoryFailedListener

Parameters:
listener - The LowMemoryFailedListener to remove.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

poll

public static void poll()
Calls the LowMemoryManager and tells it to poll device memory levels. If memory levels are low, the LowMemoryListeners are invoked in order to free up stale objects and create more free memory.

The poll method is invoked periodically by the VM, during backup and restore operations, and during memory intensive operations to indicate that there is time to cleanup resources.

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

markAsRecoverable

public static void markAsRecoverable(Object o)
Marks stale objects in memory for deletion by the VM.

Parameters:
o - The object to be released from memory.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0





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.