RIM Memory


My app crashes every time I run it in the emulator, but it works fine on the pager.

The Simulator has a bug handling applications with a declared StackSize greater then about 20000. This bug exists in the 950 SDK, but may have been fixed in other SDKs. The only work around is to redesign your app to use less stack space.


I'm out of space on my pager to load new apps. What can I do?

The biggest improvement will probably come from reloading your apps using the "grouping" syntax. If you load 3 apps separately, each app is given a chunk of file memory in 64k increments in which to reside. If the apps are much smaller then 64k, this could be a lot of wasted space. By deleting and reloading the apps as a group, the amount of space being used will probably be greatly reduced. The syntax is outlined in the programmer help. Here is an example:

programmer load ( app1.dll app2.dll app3.dll )

NOTE: the spaces in front of the parenthesis are important!

The only downside to this configuration, is that its not possible to modify any of the individual apps without removing and reloading all of the apps in the group.


How can I make my apps smaller? 

There are several things you can do. Below is a list of suggestions from RIM. (Thanks to Mike Bailey!)

  1. Compile your application under Win32 Release mode. Seems simple, but if you aren't doing it, it makes a huge difference.
  2. Select the Link Tab - Customize Category and check the box "Use program
    database". By storing the debug information in a separate file, the application size is reduced.
  3. Select the Link Tab - Customize Category and uncheck the box "Link
    incrementally". Normally this is checked. Incremental linking makes your compiles faster, but may introduce wasted space in the app.
  4. Select the Link Tab - General Category and uncheck the box "Generate debug
    info". See #1 above.
  5. Select the Link Tab - General Category and check the box "Ignore default
    libraries".
  6. Select the C/C++ Tab - Optimization Category and select "Minimize Size" in
    the Optimizations field.
  7. Select the C/C++ Tab -Select the C/C++ Tab - Project Options field, add
    the line "/GF". This will eliminate duplicate string and store strings in
    ROM.
  8. In Visual C++ 6.0, go to Project - Settings - Link - General - Project
    Options and enter "/align:16". This significantly reduces the size of the
    DLLs.
  9. In Visual C++ 5.0, you can use the #pragma data_seg() function to save
    your arrays into flash. It specifies the default section for data. For
    example: pragma data_seg( "MY_DATA" ) causes data allocated following the
    #pragma statement to be placed in a section called MY_DATA. Data allocated
    using the data_seg pragma does not retain any information about its
    location. Here is some sample code to illustrate this:

    #pragma data_seg(  ".text"  )
    static char *CloseCallMenuItems[ ] = {
    MENU_SEPARATOR_BAR,
    "Send Request",
    "Change Option",
    MENU_SEPARATOR_BAR,
    "Cancel"
        };
    #pragma data_seg( )

Website design: Sessionware  Copyright ©2001 Bill Foust.  The BlackBerry and RIM families of related marks, images and symbols are the exclusive properties and trade-marks of Research In Motion Limited and are used by permission.  Trademarks and product names listed on this site are the sole property of their respective owners.  This page last updated on April 05, 2001