BlackBerry Forums Support Community

Closed Thread
LinkBack Thread Tools
Old 05-30-2005, 03:14 AM   #1 (permalink)
Knows Where the Search Button Is
Join Date: Jan 2005
Location: MAH
Posts: 38
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default How to count Object handles?

Please Login to Remove!

Hi all,

Im writing data in persistent storage. How can I check it out that how much object handles are being consumed. I know about the Memory & MemoryStats classes & even Honestly, I had tried the same. However, I could not make it out properly that how much object handles are available now.
Can anybody help me in,
Q1. What is the relation between all kinds of Memories like Flash, Persistent, Transient, RAM.
Q2. Somewhere I read that for 32mb Flash, there could be 65,000 Persistent Object handles, like for 7100t, but I found no function among these (Memory & MemoryStats) which gives me such number.
Q3. What is the difference between Persistent Object handles & Object handles?

Please clarify these points & provide me the way (or proper classes/functions) to calculate the free memory & avaialable Persistent object handles.

Thanx in advance.

Old 05-30-2005, 08:23 AM   #2 (permalink)
Thumbs Must Hurt
Join Date: Aug 2004
Location: Metro NYC
Posts: 175
Post Thanks: 0
Thanked 0 Times in 0 Posts

To view the state of memory, set a breakpoint in your app and run it. When you hit the breakpoint, select "Memory Statistics" from the "View" menu and click "Refresh".

Persistent memory is used for storage of objects that can persist from one running of the app to another. Or are available after you turn off the device. Persistent memory is stored in Flash.

Transient memory is lost after you exit the app and is stored in RAM.

Flash is much slower than RAM.

Each object stored in persistent memory consumes a handle. So, a vector of 10 objects will consume 11 persistent object handles (1 + 10). A 32MB device is limited to about 65,000 persistent object handles. In some cases, you may run out of persistent object handles well before you run out of memory.

"Object handles" are similar but are for transient objects.
-- Aric Rosenbaum
BlackBerry consulting, BlackBerry development
BlackBerry consulting and development (RIM SI Partner)

Copyright 2004-2016
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.