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
Contributor
richlowenberg
Posts: 11
Registered: ‎04-28-2011
My Device: Torch, Bold OS6, Bold OS5

Memory problem after changing pages several times (Webworks)

I have a very simple webworks app that simply displays information. There is almost no JavaScript, no frameworks, and the only blackberry invocation is for loading a URL in the web browser. No ajax, no geolocation or anything like that. After about ten page views or so it crashes, on my Bold it gives a memory error, on my Torch it freezes without an error. The pages are small and not image heavy, and there is no animation.

 

Is there a workaround for this? Are there any known solutions? Are there examples of WebWorks apps that work or is this framework not ready for the big time yet?

 

Thanks,

 

 

Rich.

Retired
astanley
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Memory problem after changing pages several times (Webworks)

There are many examples of apps created using the WebWorks framework:

http://appworld.blackberry.com/webstore/search/webworks

 

 

That crashing behavior should not be happening.  Can you provide some additional info:

 

 

  • What version of the BlackBerry device software are you running on your Bold and Torch?
  • Which of the WebWorks SDK tools are you using (plug-in for VS, Eclipse or the command line utility)?
  • What is your JavaScript doing?  e.g. are you using any setTimeout calls?

 

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Contributor
richlowenberg
Posts: 11
Registered: ‎04-28-2011
My Device: Torch, Bold OS6, Bold OS5

Re: Memory problem after changing pages several times (Webworks)

Thanks astanley,

 

The Torch is running 6.0.0.246, the Bold is running 6.0.0.294. No set timeout calls, the JavaScript does very little, in fact this is all there is, other than a dynamic script that's loaded from a server which makes a single call to the switchImage function here.

 

I'm using the Eclipse plugin and doing everything from there. I'm going to try rebuilding the projects from scratch and see if that helps, I'll post here if there's any progress.

 

Thanks again,

 

 

Rich.

 

 

CODE:

 

function showMenu(){

if(document.getElementById("menu").style.display == "none"){

document.getElementById("menu").style.display = "block";

document.getElementById("menuBg").style.display = "block";

 }else{

document.getElementById("menu").style.display = "none";

document.getElementById("menuBg").style.display = "none";

}

}

 

function goToPage(pageId){

window.location = pageId;

}

 

function chat(){

if(officesOpen == "open"){

 loadURLInBrowser("url removed for demo sake");

}

}

 

function sendEmail(){

 window.open("mailto:anemail@domain.com", "_self");

}

 

function loadURLInBrowser(toLoad){

var args = new blackberry.invoke.BrowserArguments(toLoad);

blackberry.invoke.invoke(blackberry.invoke.APP_BROWSER, args);

}

 

function switchImage(id, url){

document.getElementById(id).src=url;

}

 

var officesOpen = "closed";

Contributor
richlowenberg
Posts: 11
Registered: ‎04-28-2011
My Device: Torch, Bold OS6, Bold OS5

Re: Memory problem after changing pages several times (Webworks)

OK, I may have a clue, not sure if this could be it. When I create a webworks project I get the following conflicts with Static Web Module in Eclipse: http://screencast.com/t/WGnYlYUPSpL. This gives me workspace build errors, so I disabled this module for the projects when I first set them up (apologies, it was a while ago and I forgot that I'd done that).

 

Could this be the problem? I'll look around for ways to keep the static web module active and still have a functioning project.

 

Thanks,

 

 

Rich.

Retired
astanley
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Memory problem after changing pages several times (Webworks)

Hi Rich,

 

Yes, that is the culprit.  Good find in identifying the missing dependancy.  If you do not have Static Web Module enabled, you will get issues when you try to build & deploy your WebWorks application.

 

Sincerely,

Adam

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Contributor
richlowenberg
Posts: 11
Registered: ‎04-28-2011
My Device: Torch, Bold OS6, Bold OS5

Re: Memory problem after changing pages several times (Webworks)

Well, i'm still trying to solve it. I reinstalled Eclipse and got everything compiling fine with the correct modules installed (there was a new javascript one in there too that hadn't been there before). But the reinstall invalidated my keys, importing didn't work, and I applied for new ones on monday with no response. I sent an email to customer service on Wednesday to get keys reissued and no response there yet either. So I'm sort of stuck until I can sign it and test. Will update the thread when I'm able to see if it works.

 

Thanks very much for the help! If you have any tips on getting signing keys a bit faster that would be appreciated too!