Series 40 devices typically have their Java heap size set to a maximum of 2 MB. Symbian devices have a maximum Java heap size of 32 MB.
In devices based on the Symbian platform
the Java heap grows and shrinks dynamically. This means that the values
returned by Runtime.totalMemory
and freeMemory
methods can vary over time.
Not all
Java objects are stored in the Java heap, some parts can be stored
also in host OS memory. For example, only a handle for Image
is stored in the Java heap and the actual bitmap is stored in host
OS memory. This can cause a discrepancy between Runtime.freeMemory
and actual free RAM in device. It is possible that OutOfMemoryError
is thrown even when it seems that the object should fit to Java
heap.
From S60 3rd Edition onwards, the com.nokia.memoryramfree
system property can be used fetch free RAM. For more information,
see section Nokia-specific system properties.
All noncritical applications, including MIDlets, are closed when the user removes the memory card. The MIDlet is closed regardless of the drive on which it is installed or the state of phone memory or memory card.
Many Symbian^3 and newer devices use graphics hardware acceleration, for example when using 3D graphics APIs. These devices have 32 MB high speed dedicated graphics memory. Graphics memory management is handled automatically for MIDlets, but mixing 3D graphics, 2D graphics, and text is not recommended. Otherwise graphics memory consumption increases and performance suffers. If the MIDlet needs to use several different elements, it is recommended that the 3D graphics and video are shown in full screen, and the 2D and text elements are kept small and fixed size. For more information, see section Graphics hardware acceleration.