no more memory in localstorage

108 views
Skip to first unread message

CODEY

unread,
May 17, 2013, 3:02:16 PM5/17/13
to phon...@googlegroups.com
I have an app that saves lots of data into localstorage ... i have one user who has a few hundred files now, and has seen some errors come up ..  I traced it to a memory limit for localstorage ... is there a way around this?

Kerri Shotts

unread,
May 17, 2013, 4:02:49 PM5/17/13
to phon...@googlegroups.com
If you're using the Web Storage SQLite database, you could always migrate to a SQLite plugin which stores the database in persistent storage.

Otherwise, no: localStorage is limited (and for good reason). You'll need to re-architect the app to avoid dependence on localStorage and use persistent storage instead.


___________________________________
Kerri Shotts
photoKandy Studios, LLC


Social Media:
          Twitter: @photokandy, http://twitter.com/photokandy
          Tumblr: http://photokandy.tumblr.com/
          Github: https://github.com/kerrishotts
                        https://github.com/organizations/photokandyStudios
          CoderWall: https://coderwall.com/kerrishotts

Apps on the Apple Store:

Books:

On Friday, May 17, 2013 at 2:02 PM, CODEY wrote:

I have an app that saves lots of data into localstorage ... i have one user who has a few hundred files now, and has seen some errors come up ..  I traced it to a memory limit for localstorage ... is there a way around this?

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
 
To compile in the cloud, check out build.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

CODEY

unread,
May 17, 2013, 5:01:11 PM5/17/13
to phon...@googlegroups.com
Ok i may try WebSQL ... there is no limit on how large a WebSQL DB can be in chrome or safari, and safari mobile (ipad) ?

CODEY

unread,
May 17, 2013, 5:03:36 PM5/17/13
to phon...@googlegroups.com
what are the options for persistent storage in chrome and safari?

CODEY

unread,
May 17, 2013, 5:05:10 PM5/17/13
to phon...@googlegroups.com
Let me ask this way  .. .what is the simplest way to get unlimited storage in a phonegap app where the app needs to work on chrome, safari on a PC as well with the same code base?

Kerri Shotts

unread,
May 17, 2013, 5:05:18 PM5/17/13
to phon...@googlegroups.com
Any local storage option (including Web storage) has a pretty low maximum limit (between 5 and 50mb, depending on platform).

The only way to avoid the low limit is to use a native SQLite plugin (which writes files to the user's persistent storage and not to the browser's storage) OR use the File APIs in order to access the same persistent storage (if your model isn't suited for SQLite).


___________________________________
Kerri Shotts
photoKandy Studios, LLC


Social Media:
          Twitter: @photokandy, http://twitter.com/photokandy
          Tumblr: http://photokandy.tumblr.com/
          Github: https://github.com/kerrishotts
                        https://github.com/organizations/photokandyStudios
          CoderWall: https://coderwall.com/kerrishotts

Apps on the Apple Store:

Books:

CODEY

unread,
May 17, 2013, 5:10:08 PM5/17/13
to phon...@googlegroups.com
ok cool thanks

Kerri Shotts

unread,
May 17, 2013, 5:18:29 PM5/17/13
to phon...@googlegroups.com
No easy way, I'm afraid. 

All desktop and mobile browsers have localStorage limits. Some are more generous than others and will let it be extended to pretty large amounts (and some can be run with a flag that disables limits entirely), but you should never rely on this. (And running with specific flags is highly unlikely for your user base).

Furthermore, even if you do decide to use the HTML5 File API (Exploring the FileSystem APIs - HTML5 Rocks), most desktop browsers will impose a similar limit on you.


___________________________________
Kerri Shotts
photoKandy Studios, LLC


Social Media:
          Twitter: @photokandy, http://twitter.com/photokandy
          Tumblr: http://photokandy.tumblr.com/
          Github: https://github.com/kerrishotts
                        https://github.com/organizations/photokandyStudios
          CoderWall: https://coderwall.com/kerrishotts

Apps on the Apple Store:

Books:

Reply all
Reply to author
Forward
0 new messages