-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebSQL threw an error Error: Failed to allocate a 102367240 byte allocation with 16777216 free bytes and 52MB until OOM #90
Comments
I'm having a similar error, but for an even smaller allocation. It occurs when doing an allDocs() call. 77571080 bytes (77MB) |
Looks like this is the same thing: nolanlawson/cordova-plugin-sqlite-2#45 |
did you fix it ? @mikeymckay ,I'm still facing this issue |
The fix I used is a hack. Basically you can't do a large single request to
the database. I was doing an allDocs that returned about 70mb worth of
data. This creates a single 70mb string which apparently can't be handled
by the Cordova to sqlite connector. So I created a recursive allDocs
function that gets smaller chunks of the data at a time and then puts it
all together.
Here's my fix on CoffeeScript:
```
# Using allDocs without limit causes error on sqlite
Person.allLocalPeopleIds = (options = {limit:100}, ids=[]) =>
database.allDocs(options).then (result) =>
ids = ids.concat(_(result.rows).pluck("id"))
if result and result.rows.length > 0
options.startkey = result.rows[result.rows.length-1].id
options.skip = 1
Person.allLocalPeopleIds(options, ids) #Recurse until done
else
Promise.resolve(ids)
```
…On Tue, Sep 18, 2018, 3:47 AM ganeshmogare ***@***.***> wrote:
did you fix it ? @mikeymckay <https://github.com/mikeymckay> ,I'm still
facing this issue
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#90 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAu79DjkTnwjUMiF-2VSfsI26p-AzLxks5ucEK9gaJpZM4WCb3a>
.
|
Here's a nicer rendering of the code: # Using allDocs without limit causes error on sqlite
Person.allLocalPeopleIds = (options = {limit:100}, ids=[]) =>
database.allDocs(options).then (result) =>
ids = ids.concat(_(result.rows).pluck("id"))
if result and result.rows.length > 0
options.startkey = result.rows[result.rows.length-1].id
options.skip = 1
Person.allLocalPeopleIds(options, ids) #Recurse until done
else
Promise.resolve(ids)
|
thanks @mikeymckay , but i have already tried this hack , didn't help :-( |
Perhaps your documents are too large so any attempt to get one requires to
much memory. If that's the case you can either redesign the docs or figure
out how to make indexeddb work.
…On Wed, Sep 19, 2018, 4:10 AM ganeshmogare ***@***.***> wrote:
thanks @mikeymckay <https://github.com/mikeymckay> , but i have already
tried this hack , didn't help :-(
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#90 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAu73AanmddiK8nctwPBGdy8jz4EKRwks5ucZmLgaJpZM4WCb3a>
.
|
I have a new customer who encountered this issue with PouchDB, and I explained the cause here: storesafe/cordova-sqlite-storage-help#70 (comment) I published a workaround solution in a SQLite plugin fork which is available under GPL v3 or commercial license options: https://github.com/brodysoft/cordova-plugin-sqlite-evplus-ext-common-free (please contact me privately if interested in the commercial license option) |
Hi, please help me out to fix this issue , i'm using pouchdb with sqlite cordova ,
version : 1.0.0
Error is :
The text was updated successfully, but these errors were encountered: