If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

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
New Developer
New Developer
GH
Posts: 16
Registered: ‎06-11-2009
My Device: Not Specified

Device memory is Low issue for an WebWork app

I am developing an WebWork app which calls a lot of XML data from the web server and display it on the page. The problem we have encountered is that after we have upgraded our Torch to 6.0 Bundle 2475, after we have used the app to load data for a few times, the app will say "Device Memory is Low" and request to close some opened application......

 

For sure I have only opened my application only and we have only used it for while, and after a few more click, the system will force the app to quit.

 

Some said this is RIM OS6 Bundle 2475 BUG and there must be a wait to handle this right?  

 

RIM PLEASE HELP OR ANYONE BETTER THEN RIM, PLEASE HELP!!!

 

Any method we can clear up the cache or reduce the memory usage?

 

Programming style:

We are using several HTLM pages to call different screen.   Each page load required to send request to the server and receive XML data.  

 

Any way to clear cache in between page load?

 

Alex

 

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Device memory is Low issue for an WebWork app

We have found similar issues which narrow down to using the Browser Field that is used to render the content which does have a memory issue in certain situations.

 

You can minimize the impact by reducing the number of times you change the location of the document.  Loading a bunch of pages in sequence can aggrevate the issue.  If your application is built as a single page while loading other content via AJAX the issue is less apparent.

 

Closing your app and re-opening it will not resolve the issue, it is a memory issue in the Browser Field that we are developing a work around in WebWorks to deal with the issue.

 

We have a solution in progress.  First will likely see an incremental solution, followed by a full solution.

 

In parallel the Browser team has fixed the root of the issue in upcoming BB6 releases and it has been resolved in BB7

 

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
New Developer
New Developer
GH
Posts: 16
Registered: ‎06-11-2009
My Device: Not Specified

Re: Device memory is Low issue for an WebWork app

mm... Sorry that I am not very smart. Is that "reduce the change of the location of docment" means

 

"I write all html page in the same html page using div tag hidden/display and ajax to control its display content so that it will not change the location of document" ?

 

 

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Device memory is Low issue for an WebWork app

Yes, that is what I'm referring to. You don't necessarily need to embed it all in one page and make it visible/invisible.

You can still have your application have these sections in separate files that just contain the divs. You can retrieve the content of the div via XHR and then insert them into the DOM dynamically

It will depend on what you are doing to figure out which approach works best for your scenario
Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
New Developer
New Developer
GH
Posts: 16
Registered: ‎06-11-2009
My Device: Not Specified

Re: Device memory is Low issue for an WebWork app

If we do this, we will need to create a new page and include all the javascript function into the same page.... and use link to call and then include others page into this "Master Page" 

 

To do, will this for sure solve the memory issue?  This is a very big modification process.  This nearly completely rewrite our app.  We really want to make sure this will work before starting the modification.

 

Also, is this the programming style which RIM advise developer to do? A style / direction which will work for OS7 and future OS?

 

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Device memory is Low issue for an WebWork app

This would be our recommended programming style for WebWorks apps.  Basically moving from page to page means the DOM gets destroyed and re-created each time and your JavaScript needs to be re-parsed.  For the most performant application this style works best.

 

These changes will not guarantee a "fix" for the problem, but will further minimize the chances of this happening.  A fix in the WebWorks framework is underway to work around this bug in the Browser Field

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
New Developer
New Developer
GH
Posts: 16
Registered: ‎06-11-2009
My Device: Not Specified

Re: Device memory is Low issue for an WebWork app

As you mentioned about DOM, in fact, in my app, almost each page call XML from Internet (and of course it use DOM), are there any solution on DOM problem for the XML calling? And also, I am planning to use JSON for future version (not in this version), will it have DOM problem or other problems?

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Device memory is Low issue for an WebWork app

There really isn't a DOM problem.  The problem is when the document changes locations.  Changing locations requires the old document to be tore down and the new one created.

 

This is at the root of the issue that you are having.  Right now there is an issue in Browser Field where the old DOM (while it has been tore down) is still in memory.  Thus causing a leak.  So multiple page changes (URL of page changes) causes the leak to grow.

 

This has been fixed in newer BB6 builds and also fixed in BB7.  For affected BB6 devices we are building a solution into the WebWorks framework to detect these situations and pro-actively clean up the leak created by the Browser Field.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
New Developer
New Developer
GH
Posts: 16
Registered: ‎06-11-2009
My Device: Not Specified

Re: Device memory is Low issue for an WebWork app

We are already using the latest WebWork SDK and testing the app in a Device which running the latest OS6 bundle but this issue is still happening.

 

So, RIM will launch a new WebWork version which will fix this bug or a newer OS6 bundle will fix this issue?

 

 

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Device memory is Low issue for an WebWork app

Both...

 

RIM will fix the issue in newer versions of BB6 and WebWorks will release a new version that has a patch/fix to this issue so that users don't need to upgrade their OS to get the fix

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.