BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 03-23-2009, 09:56 AM   #1 (permalink)
Knows Where the Search Button Is
 
pravin's Avatar
 
Join Date: Feb 2008
Model: 8130
PIN: N/A
Carrier: Sprint
Posts: 37
Post Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs down displaying System busy icon

Please Login to Remove!

Hi All,

I am working on my mapping application, and it is working fine at the starting point.

Once i scroll the application for a long time it display system busy icon at the center of the screen and stop all other operation of the application.

I found it may be due to System.gc(). however I am not calling any system.gc() in my application.

It irritate too much and not able to play with application.

I need your help to find out the solution.

Any link which can give me the detailed idea, how can I reduce the memory uses on BlackBerry?

Following are the logs which I am getting-

FS: CLEAN(211 3)
FS: SLOW(2,t=269)
VM:-RORs=11K,r=0,f=0,p=MyApp
VM:-RP!s=10.8K
VM:+RP!w=0,a=0,s=3K
VM:+GC(F)w=6
VM:-GCt=47,b=0,r=0,g=1
VM:+ROR
VM:-RORs=11K,r=0,f=0,p=MyApp
VM:-RP!s=11K
VM:+RP!w=0,a=0,s=3K
VM:+GC(F)w=6
VM:-GCt=48,b=0,r=0,g=1
VM:+ROR
VM:-RORs=11K,r=0,f=0,p=MyApp
VM:-RP!s=10.9K
VM:+RP!w=0,a=0,s=3K
VM:+GC(F)w=6
VM:-GCt=47,b=0,r=0,g=1
VM:+ROR
FS: CLEAN(283 3)
FS: SLOW(2,t=296)
VM:-RORs=11K,r=0,f=0,p=MyApp
VM:-RP!s=10.9K
VM:+RP!w=0,a=0,s=2K
VM:+GC(F)w=6
VM:-GCt=47,b=0,r=0,g=1
VM:+ROR
VM:-RORs=11K,r=0,f=0,p=MyApp
VM:-RP!s=11K
VM:+RP!w=0,a=0,s=2K
VM:+GC(F)w=6
VM:-GCt=48,b=0,r=0,g=1
VM:+ROR
FS: CLEAN(294 3)
FS: SLOW(2,t=267)


Thanks in advance.
Offline  
Old 03-23-2009, 06:17 PM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

Looks like you are creating excess garbage. The system GC will kick in when memory becomes constrained, whether you called it or not.

Some things to look for:

* string concantenation, expecially within a for...next loop.
* unnec. use of Enumerations
* keeping references to objects that are no longer needed (set them to null)

...etc

Last edited by Dougsg38p : 03-23-2009 at 06:19 PM.
Offline  
Old 03-24-2009, 12:52 AM   #3 (permalink)
Knows Where the Search Button Is
 
pravin's Avatar
 
Join Date: Feb 2008
Model: 8130
PIN: N/A
Carrier: Sprint
Posts: 37
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the quick reply.

Yes I am using String concatenation in for loop as I need this, can i do this using another way ?

Do I need to set null to locally created objects also?
Offline  
Old 03-24-2009, 07:22 AM   #4 (permalink)
Knows Where the Search Button Is
 
pravin's Avatar
 
Join Date: Feb 2008
Model: 8130
PIN: N/A
Carrier: Sprint
Posts: 37
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi I found some more points -

I am using Hashtable to store the images temporary as i need old images also.
Once the size of Hashtable is around 600 KB it frequently called the GC.

I have checked the available memory also and it's in MB's.

Any one know why it is happening?

Is there any limitations of memory for each running application?
Offline  
Old 03-24-2009, 10:59 AM   #5 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

That depends on the device.

There is a heirarchy to garbage collection on the BB. It goes something like this:

#1 - RAM collection of unused objects: < ~500 ms
#2 - Collection of unused objects in object cache (flash): ~1,000 ms, then repeat #1
#3 - Collection of unsued objects in store: ~2,000 ms, then repeat #2

600KB is quite a bit of RAM for the older BlackBerry devices.
Offline  
Old 03-25-2009, 12:43 AM   #6 (permalink)
Knows Where the Search Button Is
 
pravin's Avatar
 
Join Date: Feb 2008
Model: 8130
PIN: N/A
Carrier: Sprint
Posts: 37
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes I read it at BlackBerry - BlackBerry | Wireless Handheld Devices, Software & Services from Research In Motion (RIM)


But no conformation about the RAM used for a application. As my device showing free memory aroung 23 MB then why I can not use some amount these memory for my appllication?

I need to save map images that application need at run time, is there any other fast way to save these images ?
Offline  
Old 03-25-2009, 11:54 AM   #7 (permalink)
Thumbs Must Hurt
 
Join Date: Nov 2008
Location: Sioux Falls, SD
Model: 9530
PIN: N/A
Carrier: Verizon Wireless
Posts: 65
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Also read BlackBerry Java Development Environment - Fundamentals Guide, specifically page 13 for more "Best Practices"
__________________
Handspring >> Palm >> BB Pearl >> BB Storm

Tumblog: http://www.geekkink.com
Blog: http://www.zechariahs.org/blog
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.