BlackBerryForums.com : Your Number One BlackBerry Community      

»Sponsored Links




Reply
 
LinkBack Thread Tools
  (#1 (permalink)) Old
Balauru Offline
New Member
 
Posts: 5
Join Date: Mar 2008
Model: 8120
PIN: N/A
Carrier: none
Default Key delay upon launching multiple FullScreens - 03-27-2008, 10:32 AM

Hello,
I currently have an UIApplication that launches several FullScreens, one at a time. I launch one...use it for a small amount of time then close it (deallocate what i can , popscreen make it null). After this i push another fullscreen on the screen. I use it for a while then do the same and launch a third. The problem is that after this the keys start to respond with a little delay. What could be the problem? I thought about filling up the memory but even after freeing up and optimizing it a bit with memoryup it still keeps the sluggish response. So it might be something else.

Has anyone encountered this behaviour? Any suggestions are welcome

Thank you,
Balauru
   
Reply With Quote
Sponsored Links
Please Login or Register to Remove these Advertisements!

  (#2 (permalink)) Old
Balauru Offline
New Member
 
Posts: 5
Join Date: Mar 2008
Model: 8120
PIN: N/A
Carrier: none
Default 03-28-2008, 09:34 AM

Doesn't anyone have any ideea about this?
   
Reply With Quote
  (#3 (permalink)) Old
bdowling Offline
Thumbs Must Hurt
 
Posts: 171
Join Date: Jan 2007
Model: 8800
Carrier: Orange
Default 03-28-2008, 02:34 PM

I've seen things get really slow when creating loads of objects, and doing stuff in paint, but your scenario doesn't sound like it should be slowing things down. Could you post a code sample?
   
Reply With Quote
  (#4 (permalink)) Old
Balauru Offline
New Member
 
Posts: 5
Join Date: Mar 2008
Model: 8120
PIN: N/A
Carrier: none
Default 03-31-2008, 02:54 AM

Here is a status of the memory load at one point in the application

for CODE
memory allocated: 28582264 memory free: 29390652 nr of objects: 23445
for RAM
memory allocated: 10382076 memory free: 272648 nr of objects: 39728 object size : 6937748
OBJECTSTATS
memory allocated: 82985 memory free: 119767 nr of objects: 202752 object size : 9557528

At some points the free ram drops very low. I assumed it might be something to do with that. But i have very little chance of freeing up more memory. There seems to be indeed a large number of allocated objects. The behaviour would also suggest this scenario since if i run any of the screens for the 1st time, it runs smooth. if i run it after the others it starts to loose speed.

As for the implementation i have one UIApplication that has an member
public static Object _currentScreen;

Once i need to init one of the screens i cast it to Runnable for invokeLater and to Screen to be able to push it on the screen. When i am done i deallocate what i can, use popScreen then make it null and instantiate another one.

Last edited by Balauru : 03-31-2008 at 02:59 AM.
   
Reply With Quote
  (#5 (permalink)) Old
bdowling Offline
Thumbs Must Hurt
 
Posts: 171
Join Date: Jan 2007
Model: 8800
Carrier: Orange
Default 03-31-2008, 04:21 AM

That sounds like an odd way of doing things. You shouldn't need a static currentScreen variable. You can get the current screen object with:

Code:
UiApplication.getUiApplication().getActiveScreen()
And are you saying you are casting a screen object to runnable? That sounds like your problem right there! If you want to push a screen from a non-UI thread:

Code:
UiApplication.getUiApplication().invokeLater(new Runnable() {
	public void run()
	{
		UiApplication.getUiApplication().pushScreen(myScreen);
	}
});
   
Reply With Quote
  (#6 (permalink)) Old
Balauru Offline
New Member
 
Posts: 5
Join Date: Mar 2008
Model: 8120
PIN: N/A
Carrier: none
Default 03-31-2008, 08:32 AM

Hello,
Cheers for the observation. YOu are right the casts were the problem. That came from the fact that i wanted a single object to handle all the different classes and i had to cast them. Now i made a specific object for each of the Screens i am using and the key problems seem gone.

I am not entirely convinced why the initial approach was making problems though since things worked pretty ok in the beginning but it's a good thing to remember.


Balauru
   
Reply With Quote
Reply


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-2008 BlackBerryNews.com, BlackBerryFAQ.com, BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of Research In Motion Limited.
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.1