Memory management
4
Managing memory
The BlackBerry® Java® Virtual Machine manages memory usage on the BlackBerry device. The BlackBerry JVM allocates memory,
performs garbage collection, and automatically swaps data between SRAM and flash memory. The BlackBerry JVM must also
share available memory between the BlackBerry device applications and the BlackBerry® Java Application. The memory
capabilities represent the total amount of available memory, which is larger than the available working memory when all of the
applications and associated application data exist on the BlackBerry device.
BlackBerry device memory
BlackBerry® devices include the following types of memory:
Memory
Description
flash
The BlackBerry operating system and all application modules are stored persistently
in flash memory. When a BlackBerry device user turns on the BlackBerry device, the
core operating system and the BlackBerry® Java Application modules use
approximately 10 MB to 15 MB of flash memory, depending on the version. Flash
memory can store the BlackBerry device user's email messages, organizer data, and
other personal information, as well as the data that a BlackBerry Java Application
stores in memory.
SRAM
SRAM controls the transient data objects and runtime processes.
microSD expandible memory card
The microSD card stores media files, documents, and persistent data from a
BlackBerry Java Application.
Key resources to reserve
•
Flash memory: The persistent storage space that is available on the BlackBerry® device is a fixed amount of flash memory,
typically in the range of 8 MB to 64 MB.
•
Persistent object handles: The handles that are assigned to each persistent object are consumed only by persistent objects.
The amount of flash memory on the BlackBerry device determines the fixed number of persistent object handles in the
system.
•
Object handles: Each object and array of primitives has an object handle associated with it. The amount of flash memory
on the BlackBerry device determines the fixed number of object handles in the system.
Fundamentals Guide
Memory management
24