Application taking too much space in RAM causing the app to close - blackberry

I'm having a problem with the app I'm building the RAM of the BB 9800 is too small.
I have a html5 application that I use in IOS and Blackberry.
I'm using phonegap plugin to pull data form server by using Sybase.
On IOS everything runs fine but on blackberry I frequently get a message "low on memory, please stop applications" and the only app running is mine. And usually this is followed by "app closing because its too big".
How can I either increase the memory available for my app (unlikely)
or decrease the amount my app is using (tips and guide lines)
I'm using:
Sencha Touch for our interface
Phonegap to access the native api
Sybase to do the sync between our local data and the server data
No toolkits - only one is sencha touch
everything is loaded at index.html - no ajax at all
index.html is a local file - no request loading
Sencha does the DOM stuff - not all screens in one main DOM - the screens are created on demand.

You mention you pull data from Sybase - is that when you get that memory error?
Unfortunately sencha/phonegap/sybase sync/your js will take memory (specially since it's all in one page), and those frameworks are big enough to cause troubles...
My suggestions:
if the error happens only when you load data, the question is how much data are you loading? maybe it's trying to download 1gb of data and trying to do that in memory? I would look into server-side paging to reduce your data-footprint
try to split into multiple .html pages each doing a subset of the work you are now doing in one big file...
Hope this helps

Related

How to load bulk data onto iOS device

I have to load a lot of data onto an iOS device with 128GB storage, for use by my app. The data is around 2,000 files of around 40Mb each, total is around 80GB - 100Gb.
I control the iOS device and the load machine/program and the local network they're on, and time is not critically important (if it takes a week to load, that's OK). I can format the data as required to facilitate the load.
I've done some iOS programming, but I'm not sure where to start looking for a solution to this. If you can outline the broad approach to use and which iOS docs to read up on, that's all I need.
Hoping for a solution where I can format the data and write the program, plug the iPad in to the Mac and say 'start loading' and come back when it's done.
We discovered that it is possible to load data one device at a time using iTunes, but that isn't a good answer for us.
We added a 'load data' button into the application. When triggered it loads a configuration file from a hard coded local network address, then retrieves all the data files listed in the configuration file using REST GETs from the local server, storing them into the application /Documents directory.
This is a good approach for us; it is secure, allows multiple devices to load data at the same time, and doesn't need any manual file loading : start the app, press 'load', and wait for it to finish.

Why is my website images are swapping and the page is hanging on iPhone web browsers only?

I have a website written in ASP.NET MVC (Razor). Recently, a few days ago the images on the website started swapping all over the place. When refreshing the site, it might just hang for quite some time or load all images correctly. So I plugged my iPhone to my Mac and used the web inspector to see whats going on. I found out that at the time of load the browser hangs on certain files. These files are either images or js libraries. The images are very small. Less then 10kb so it is not the size of the image.
This issue only happens on iPhones. I checked on several iPhones.
I have tried multiple Android devices, Mac and Windows computers and they all load fast and every image is in the right place - no issues.
I researched a bit and found out some interesting references to HTTP Pipelining. But if that was is the case, why would these issues start now?
I do not know what to thing anymore.
What am I trying to understand is why would that only happen on the iPhone?
Thank you,
Any clue would be appreciated.
I had the same issue. After months of breaking my head I decided to implement lazy load on all images. After that, swapping never occurred.
Page hanging could happen because of multiple reasons. I would definitely check the code again and in particular look for the way you handled unmanaged resources. More on unmanaged resources

Parse app using huge (2+GB) storage size in PFFileStaging folder

We're using Parse in our iOS app and we've discovered that our app is using an enormous amount of space -around 2.3GB in some devices- in storage. After downloading app data to my Mac, I've realized almost all of that data is the cached images in a folder called PFFileStaging, it contains highest resolution PNGs of all the PFFiles that the user has viewed in our app, ever. How can we disable this behavior, at least limit it? Is that the intended behavior? I heavily doubt using GBs of space is the intended behavior. Is this a bug?
Unfortunately this is not cache related (as per Parse's engineers: "this is used to ensure that no concurrent modification happens to the file after you request uploading").
They're planning to implement automatic trimming of PFFileStaging folder on every app start (as per road plan this should appear in next version 1.8.2).
See the the whole thread on GitHub.

PhoneGap...iOS...my app's "documents and data" keeps getting larger and larger

So we have built an app that is almost completely dynamic.
You build the content on a website and then the app pulls the content that the administrators created for the user using a REST api.
The content can be videos, images, rich text, or form controls. All of this is stored externally on our servers...not locally.
We have hundreds of pages (kinda like a choose your own adventure).
We cache some stuff...usually about 3 - 5 pages at a time, but we don't store any content locally...we save to our server only.
So we noticed something weird while testing...when we go to Settings/General/Usage/Manage Storage we noticed our app keeps getting bigger and bigger. If we drill down into the app we can see that the app itself is only 15 megs, but as you use the app it can grow to over 100 Megs.
When we close the app out completely it will shrink down by about 20%, but somehow the app is keeping stuff and I am not sure why.
Does iOS cache things on its own? Is there a way to clear that on exit?
Again, we are purposefully not saving anything...but something obviously is.
Any thoughts?
Update
So I was asked more about the tech...it is a PhoneGap app that uses JQuery ajax calls to hit a .Net Web API project.
I don't mind caching while the app is running, but when the app has been closed by the user...why is there data being stored?
Thanks,
David

iOS: Sencha Touch Application and iPads

We have been developing an application which can consume a large amount of data (say tables/proxys with 4000 + rows) in Sencha Touch.
When we run the application on our desk top computer it works fine however when the application is accessed on an iPad as soon as we get to the data heavy task safari just vaporizes .
Is this a limitation on imposed by Apple or are we getting punished for doing something wrong.
Try to load data as user request it:
http://podlipensky.com/post/2011/01/03/Sencha-Load-data-on-demand.aspx
http://www.sencha.com/forum/showthread.php?120083-Ext.ux.touch.LazyDataView
Also try to use lazy rendering for not-visible-from-start elements. You need to use xtype and json configuration instead of creating new instance of control.

Resources