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
Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Device memory is Low issue for an WebWork app

I know Nitobi was working on fixing up some memory issues with their extensions.  Not sure if they have made them in yet or not.  Also, are you using the v2.2 WebWorks SDK with phonegap?

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Contributor
Posts: 25
Registered: ‎08-02-2011
My Device: Torch 9800
My Carrier: developer

Re: Device memory is Low issue for an WebWork app

Tim  - We get the message about low memory and closing apps.

 

If it is an app cleanup issue or Google maps problem, wouldn't that also become a problem on Android?

 

Not sure if the BB memory monitor is reliable, but it shows the memory usage getting large for the app (e.g., 10MB), but then the garbage collecter runs (spinner animation) and it goes back down to 1MB.  However, the system memory usage keeps climbing--it comes down some but not as much as the app, and the difference accumulates.  Seems like that iimplies the app is releasing the memory and garbage collection is cleaning it up from what the app can see--but the OS is keeping something.

 

We use Sencha's remove whenever leaving pages or panels, which they claim cleans up all the children.  Will look more closely at all of that when time allows.

 

Thanks

 

Keith

 

New Contributor
Posts: 9
Registered: ‎11-16-2011
My Device: 9300
My Carrier: NA

Re: Device memory is Low issue for an WebWork app

[ Edited ]

We are using phonegap 1.2 - thats the latest version available. 

 

We are using the pre release. Will upgrade to 2.2 and post the results. Our app does some base64 encoding of images that takes up a lot of processing power. Earlier the app was doing base64 encoding of multiple images before sending them to a server. So we serialized the operation of base64 encoding and sending it to the server - encode one and send one. Pretty much causes a huge lag because of send times but I think we got to live with it. The images are 1600 x 1200. 

 

We also store some data as text files in the device. We are planning to push that in to a sqllite database - not sure if the file reads cause a memory issue but sometimes along with the memory warning we also get "Page is too large to load" - The text files are just multiple kbs and not that large. Would the move to storing that in the db get us better performance? Any suggestions...The memory leaks are one issue but the icon being replaced as a result is a bummer.... 

Contributor
Posts: 18
Registered: ‎10-17-2011
My Device: Torch9800
My Carrier: Bell

Re: Device memory is Low issue for an WebWork app

Hi Keith,

 

We had identified the memory climbing issue a long time ago (see this September 15th post by bbooks:http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Device-memory-is-Low-issue-for-a...).  I think the thing that has been keeping Tim from proceeding with a fix is that he isn't sure that the issue is isolated to Blackberry.

 

 

Tim,

 

I have tested and tested on the Samsung Galaxy II) and iPhone 4 and I can't seem to reproduce this memory usage increase on those phones (the memory stays relatively stable over time).  I still strongly believe that this issue is related to a bug in Blackberry's memory management.  However, I can't be 100% sure of this, because I've had to change my code a bit to work properly on the different phones.  

 

I've tried re-writing my code following suggestions by others in this thread and online to reduce the memory usage, but the memory still climbs until it eventually reaches the low memory error.  

 

 

 

New Contributor
Posts: 9
Registered: ‎11-16-2011
My Device: 9300
My Carrier: NA

Re: Device memory is Low issue for an WebWork app

[ Edited ]

Tim,

We re-compiled the app with webworks 2.2 and tried running it on the 9300 with os 6.0. Once the app is installed I just need to start and kill it about 10 times and we get the memory error - the icon is replaced by the generic folder icon. The app loads jquery mobile and phonegap. Whats worse ever since we recompiled is that after the crash the phone gives an error message 

 

Uncaught exception: Application net_rim_bb_browser_olympia_proxy(319) is not responding; process terminated"

 

Phone OS 6.0 Bundle 2342 (v 6.0.0.526)

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Device memory is Low issue for an WebWork app

Ok... I'm having a hard time following each individual user, their issue and what they are using Smiley Sad

 

Let's start off by agreeing to some terminology.  There are two distinct different scenarios and I want to ensure that we aren't chasing white rabits because of the terminology that we use.  That's just going to confuse everyone involved and make it longer to get to a resolution to each of your issues.  

 

So let's recap and make sure we are all on the same page... 

 

The two scenarios are:

"Low Memory Warning" Symptoms:

- A dialog pops up saying you are low on memory and you should close some other applications.

- The application closes unexpectedly

 

"Memory Leak" Symptoms:

- The device continues to build up memory in the application until you receive an "Out of Memory" Exception

- You need to do a battery pull to fix the issue

- This was what was patched in WebWorks v2.2 with the watch dog service

 

Now let's see if we can get some clarification so that our teams can look into your issues.

 

mannymisc

  • You are facing the "Low Memory Warning" correct?
  • The icon is being replaced by a folder icon
  • You are doing base64 encoding on large images.  Are you doing this in JavaScript or through and extension?
  • You are using a Curve 9300 with OS 6.0.0.526
  • You are using PhoneGap 1.2
  • You are using WebWorks v2.2 correct?
  • Do you have focus based navigation enabled in your application?
  • Are you using any blackberry.* APIs that have a "callback" event subscription?

 

mysudbury

  • You are facing the "Low Memory Warning" correct?
  • You are using Google Maps V3 API
  • You have tested Google Maps V3 on other phone operating systems (iOS, Android) and don't seem to get the issue
  • Have you tried Google Maps V3 in the general browser on the BlackBerry to see if there is a difference in the BlackBerry Browser and a WebWorks application?
  • Which device model and OS version are you finding the issue (i.e. Torch 9800 v6.0.0.246)
  • You are using WebWorks v2.2 correct?
  • Do you have focus based navigation enabled in your application?
  • Are you using any blackberry.* APIs that have a "callback" event subscription?

 

klevi

  • You are facing the "Low Memory Warning" correct?
  • You are using Google Maps V3 API
  • Does the system memory continue to climb when you exit and restart your application?  Or is it only continuing to climb when you leave your application open?
  • Which version of Sencha Touch are you using?
  • You are using the Torch 9800 can you specify the "dot" revision of the OS (i.e. v6.0.0.246)
  • You are using WebWorks v2.2 correct?
  • Do you have focus based navigation enabled in your application?
  • Are you using any blackberry.* APIs that have a "callback" event subscription?

 

 

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
New Contributor
Posts: 9
Registered: ‎11-16-2011
My Device: 9300
My Carrier: NA

Re: Device memory is Low issue for an WebWork app

[ Edited ]
Tim - Thanks for looking into this. Quick question - Does the cache have anything to do with it? Should we disable the cache and try? Also, was this the phonegap fix - im not sure if it has been pulled into release 1.2 - https://github.com/phonegap/phonegap-blackberry-webworks/pull/55

Answers to your questions: 
 
  • You are facing the "Low Memory Warning" correct? 
    yes 
  • The icon is being replaced by a folder icon
    yes 
  • You are doing base64 encoding on large images.  Are you doing this in JavaScript or through and extension?
    yes 
     
  • You are using a Curve 9300 with OS 6.0.0.526
    yes
     
  • You are using PhoneGap 1.2
    yes
     
  • You are using WebWorks v2.2 correct?
    yes
     
  • Do you have focus based navigation enabled in your application?
    no 
     
  • Are you using any blackberry.* APIs that have a "callback" event subscription?
    We do some file IO in phonegap. When the app opens up it reads a text file of image locations. Now, we are planning to use sqllite/localstorage apis. Below is the config.xml. 

  <feature id="blackberry.find" required="true" version="1.0.0.0" />

  <feature id="blackberry.identity" required="true" version="1.0.0.0" />
  <feature id="blackberry.pim.Address" required="true" version="1.0.0.0" />
  <feature id="blackberry.pim.Contact" required="true" version="1.0.0.0" />
  <feature id="blackberry.io.file" required="true" version="1.0.0.0" />
  <feature id="blackberry.utils" required="true" version="1.0.0.0" />
  <feature id="blackberry.io.dir" required="true" version="1.0.0.0" />
  <feature id="blackberry.app" required="true" version="1.0.0.0" />
  <feature id="blackberry.app.event" required="true" version="1.0.0.0" />
  <feature id="blackberry.system.event" required="true" version="1.0.0.0" />

 

 

Highlighted
New Contributor
Posts: 9
Registered: ‎11-16-2011
My Device: 9300
My Carrier: NA

Re: Device memory is Low issue for an WebWork app

[ Edited ]

Tim,

An easy way to reproduce the memory error - compile the phonegap sample application - Phonegap v 1.2 webworks 2.2. Start and stop it for about 10 - 15 times (at least on the 9300).

 

Contributor
Posts: 25
Registered: ‎08-02-2011
My Device: Torch 9800
My Carrier: developer

Re: Device memory is Low issue for an WebWork app

Thanks for the ongoing attention.  We still get the memory issues, so will be great if it gets resolved.

 

 

  • You are facing the "Low Memory Warning" correct?
    •  A: yes, although there is always the warning before the app closes

 

  • You are using Google Maps V3 API
    • we use http://maps.google.com/maps/api/ on one screen, but the memory issues also show up on other screens that do not use this one.  Have been running same app on Android for several months and have never had any memory issues.  Several hundred users in the field using that.

 

  • Does the system memory continue to climb when you exit and restart your application?  Or is it only continuing to climb when you leave your application open?
    • seems to only climb when using the app, although after having repeated memory problems it seems like the warning comes up more quickly.

 

  • Which version of Sencha Touch are you using?
    • v1.1

 

  • You are using the Torch 9800 can you specify the "dot" revision of the OS (i.e. v6.0.0.246)
    • v6.0 Bundle 2647(v6.0.0.600, Platform 6.6.0.223)

 

  • You are using WebWorks v2.2 correct?
    • yes

 

  • Do you have focus based navigation enabled in your application?
    • no

 

  • Are you using any blackberry.* APIs that have a "callback" event subscription?
    • yes, navigator.geolocation.getCurrentPosition(successCallbk, errorCallbk, geoOptions)
Contributor
Posts: 18
Registered: ‎10-17-2011
My Device: Torch9800
My Carrier: Bell

Re: Device memory is Low issue for an WebWork app

mysudbury

  • You are facing the "Low Memory Warning" correct?

Yes

 

  • You are using Google Maps V3 API

Yes

 

  • You have tested Google Maps V3 on other phone operating systems (iOS, Android) and don't seem to get the issue

That is correct.  The app works on iPhone and Android... I have tested many times and we have had hundreds of downloads over the past couple months without any reported problems.

 

  • Have you tried Google Maps V3 in the general browser on the BlackBerry to see if there is a difference in the BlackBerry Browser and a WebWorks application?

Yes I have, and I do not get the same issue in the Browser.  I believe that the problem is isolated to WebWorks.  I understand that WebWorks has less memory allocated to it, but the problem seems to be more than just "running out of memory".  The problem is that the memory builds up over time until it reaches this limit and returns the low memory error (and eventually closes the app on its own).   

 

  • Which device model and OS version are you finding the issue (i.e. Torch 9800 v6.0.0.246)

Torch 9800 v6.0.0.600, Platform 6.6.0.223

 

  • You are using WebWorks v2.2 correct?

Yes

 

  • Do you have focus based navigation enabled in your application?

No

 

  • Are you using any blackberry.* APIs that have a "callback" event subscription?

No