06-24-2011 06:29 AM
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
06-24-2011 07:16 AM
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
06-24-2011 07:25 AM
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" ?
06-24-2011 07:39 AM
06-24-2011 08:54 AM
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?
06-24-2011 09:06 AM
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
06-24-2011 09:23 AM
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?
06-24-2011 09:59 AM
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.
06-24-2011 10:08 AM
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?
06-24-2011 10:21 AM
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