Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Developer
Posts: 146
Registered: ‎02-19-2011
My Device: Bold 9930 and PlayBook

App slow to close

I'm a bit stumped with my latest problem.  My WebWorks App uses JQuery 1-6.1 and JQuery UI 1.8.13 for UI features, DOM manipulation, and AJAX querying.  The situation is when the user requests data via an AJAX call to a web service my application then takes a stored HTML string and updates the string with the returned data.  Then using JQuery it adds this HTML to the DOM by using $("table#mainTable").prepend(html).hide().fadeIn(1000);  All this works great, the problem is when the user attempts to close the Application the app hangs for anywhere from 2 seconds to 15+ seconds.  

 

I thought maybe there were hung AJAX calls so I overrode the close logic to call the .abort() function call on all possible queries if they weren't already set to null.  This still didn't seem to work.  Does anyone have any insight or ideas? 

"Not to know what happened before you were born is to be forever a child." Marcus Tullius Cicero
Developer
Posts: 214
Registered: ‎01-07-2011
My Device: Bold 9900
My Carrier: Rogers

Re: App slow to close

It has to do with the garbage clean-up that occurs with webworks. It used to happen when memory usage changed more than 5 or 10% but that caused apps to delay on start-up and random points during execution. To deal with that it now runs on close. So it is out of your control at the moment, but I belive there are more improvements coming with WW 2.4.

 

The delay probably gets longer as you load more data into the app.

--
Rory (@roryboy)
Click "Accept as Solution" if post solved your original issue. Give like/thumbs up if you feel post is helpful
Developer
Posts: 146
Registered: ‎02-19-2011
My Device: Bold 9930 and PlayBook

Re: App slow to close

That would make sense, my app does use a lot of data.  Has there been any word on the street as to when WW 2.4 might be coming out?  The problem has been severe enough I've considered redoing the phone version of my app with Java.

"Not to know what happened before you were born is to be forever a child." Marcus Tullius Cicero
Developer
Posts: 161
Registered: ‎02-08-2012
My Device: PlayBook
My Carrier: None yet

Re: App slow to close

they moved GC to app close only? what's the point of even doing it then? just let the OS take care of it when it kills the binary..

Developer
Posts: 214
Registered: ‎01-07-2011
My Device: Bold 9900
My Carrier: Rogers

Re: App slow to close

Just double checked, the changes with the memory maid were:

Increased change threshold from 5 to 10%
Won't run until first page is loaded
And a system.gc is run on exit no matter what.
+ a bunch of smaller tweaks

If you want complete details they are at the link below. I am not sure how much improvement 2.4 will have for this, one of the RIM folks might be able to better comment.

https:// github.com/blackberry/WebWorks/issues/78
--
Rory (@roryboy)
Click "Accept as Solution" if post solved your original issue. Give like/thumbs up if you feel post is helpful
Developer
Posts: 161
Registered: ‎02-08-2012
My Device: PlayBook
My Carrier: None yet

Re: App slow to close

ok, that is an almost entirely different thing :smileyvery-happy:

so i guess any open ww apps all run in a single process then. that makes sense too.