SHOW Signed
 

net.rim.device.api.lowmemory
Class LowMemoryManager

java.lang.Object
  |
  +--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.

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:
JDE 3.6.0
See Also:
LowMemoryListener, LowMemoryFailedListener

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.
Since:
JDE 4.0.2
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.
Constructor Detail

LowMemoryManager

protected LowMemoryManager()
Creates a new LowMemoryManager instance.

Since:
JDE 3.6.0
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.
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.
Since:
JDE 3.6.0
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.

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.
Since:
JDE 3.6.0
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.

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.
Since:
JDE 3.6.0
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.

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.

Since:
JDE 3.6.0
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.

removeLowMemoryFailedListener

public static void removeLowMemoryFailedListener(LowMemoryFailedListener listener)
Removes a LowMemoryFailedListener

Parameters:
listener - The LowMemoryFailedListener to remove.
Since:
JDE 3.6.0
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.

removeLowMemoryListener

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

Parameters:
listener - The LowMemoryListener to remove.
Since:
JDE 3.6.0
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.



Copyright 1999-2009 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.