Symbian
Symbian OS Library

FAQ-0478 How can I mimic out of memory in the Emulator?

[Index][spacer] [Previous] [Next]



 

Classification: Java Category: Emulator
Created: 03/17/2000 Modified: 07/22/2003
Number: FAQ-0478
Platform: Not Applicable

Question:
OOM is the rule not the exception. So how can I mimic out of memory in the Emulator?

Answer:
The heap allocation tool can be used to invoke heap failures. This is accessible from the debug Emulator by entering Ctrl+Alt+Shift+P. Its use is documented in the C++ SDK and in Professional Symbian Programming (p158ff).

Less well known is the ability to limit the total memory allocated to the Emulator. This can be set in the .ini files found in \epoc32\data. From the C++ system documentation:
    "The MegabytesOfFreeMemory setting in the emulator configuration file sets the maximum total heap size in megabytes, in order to emulate target machines with different memory capacities. If this parameter is not specified, the amount of free memory defaults to 64MB.

    If you wish to limit the heap, it is conventional to allow one megabyte for EPOC system use: for example, specify 7 to simulate a 8MB machine."
    So for instance if you want to emulate a 4MB machine, change the relevant .ini file to:

    ScreenOffsetX 90
    ScreenOffsetY 51
    LedOffsetX 36
    LedSize 14
    _epoc_drive_j H:\erj
    MegabytesOfFreeMemory 3

    See also "Is there a list of existing Symbian OS emulator hotkeys?" in the C++ Knowledge Base.