07-06-2010 06:03 AM
hello friends,
How do i calculate the size of vector object being persisted to persistant store.? I want to know how much space the vector object utilises in the persistant store, How do i find out? Please help
thanks guys
07-09-2010 10:58 AM
There are no methods to determine this programmatically. However, you can use the memory statistics tools in the BlackBerry Java Plug-in for Eclipse and BlackBerry JDE to observe this while debugging. You can refer to the BlackBerry Memory Statistics and BlackBerry Object views within Eclipse.
07-13-2010 04:32 AM
Hi mark thanks for the reply.
My intention is to show the user how much memory the app is using in persistant store. Say for example the app allows to download mp3 and store in persistant store. So the user can see how much space the objects stored in persistant store are using up and clear the persistant store if they want to.
Is there any way they can do it?
07-13-2010 04:41 AM
Mark is right.
There is no direct way we can calculate exact memory of persisted object.
Assuming that you just want to care about the storage of your application alone. You can fetch the persistence memory accessing the key and fetching the vector from that memory.
After than
Either you can count vector's size. and easily show number of objects stored in memory.
Or
Fetch every object from vector. Count the bytes and convert them into mb and show them, but afaik it will not be convenient way, neither we can get perfact data.
07-13-2010 06:07 AM
Agree with prash_bb_dev.
I would also encourage you to store large byte image type files, like MP3s, on the SD Card and not in persistent store.
07-13-2010 06:22 AM
yes peter. and as i said earlier mp3 was an example.
Thanks