Display objects in memory to locate object leaks
Object leaks can cause the VM to run out of flash memory, which forces a BlackBerry® device to reset.
Display format
The Name column displays each process in the following format: process_name(process_id): status
where status is one of the following: Add, Delete, Referenced by code, Referenced by static, Grouped, Persistent, RAM.
Use the Objects tool to find a memory leak
- In the BlackBerry® IDE, on the Debug menu, click Go.
- On the Debug menu, click Break Now.
- On the View menu, click Objects.
- In the objects pane, click GC.
- In the objects pane, click Snapshot.
- On the Debug menu, click Continue.
- Perform operations in the application that do not increase the number of reachable objects. For example, create a new contact and then delete it.
- On the Debug menu, click Break Now.
- In the objects pane, click GC.
- Click Compare to Snapshot.
The objects pane 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 an object leak. To narrow new objects, use the Type, Process, and Location filters located at the top of the objects pane.
- To save the contents of the objects pane to a comma separated values (.csv) file, click Save.
Show references to or from an object
> In the objects pane, right-click an object, and then click Show References to or Show References From.
The object view narrows to show only the objects that have references to or from this object. Use the Forward and Back buttons to move back and forth through the reference chain.
Right-click an object, and then click Show Recursive References To @nnnnnnnn to display all objects that reference the selected object. An object can be displayed indirectly through another object.
View the source code or static data member
View all objects that reference a list of objects
View a list of references between two objects
Related topic