Locating memory allocation problems

Memory allocation problems can cause the BlackBerry® Java® Virtual Machine to run out of flash memory, and the BlackBerry device to reset.

Viewing memory statistics

You can use the Memory Statistics tool with the Objects tool to find memory allocation problems. The Memory Statistics tool retrieves information about the memory usage of your application, and identifies the number of objects stored in memory. The Objects tool displays detailed information about each object.

Perform operations in the application that do not increase the
number of reachable objects. For example, create a new contact and then delete
it.

In the
Debug view, click
Suspend.

In the
BlackBerry Objects View, click
Perform garbage collection.
The
BlackBerry Objects View displays the number of
objects that have been deleted and added since the previous snapshot. If the
number of objects added is not the same as the number of objects deleted, you
might have a memory allocation problem.

To identify new objects, use the
Type,
Process, and
Location filter types in the
Objects View Options dialog box.

To save the contents of the
BlackBerry Objects View to a comma-separated
values (.csv) file, click
Save.