Skip to content
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

Open
AlienHu opened this issue Aug 18, 2018 · 8 comments

Comments

@AlienHu
Copy link

AlienHu commented Aug 18, 2018

Hi, please help me out to fix this issue , i'm using pouchdb with sqlite cordova ,

version : 1.0.0

Error is :

status: 500,
 name: "web_sql_went_bad", 
message: "unknown",
 error: true,
 reason: "Failed to allocate a 102367240 byte allocation with 16777216 free bytes and 52MB until OOM"
@mikeymckay
Copy link

mikeymckay commented Aug 30, 2018

I'm having a similar error, but for an even smaller allocation. It occurs when doing an allDocs() call.

77571080 bytes (77MB)

@mikeymckay
Copy link

Looks like this is the same thing: nolanlawson/cordova-plugin-sqlite-2#45

@ganeshmogare
Copy link

did you fix it ? @mikeymckay ,I'm still facing this issue

@mikeymckay
Copy link

mikeymckay commented Sep 18, 2018 via email

@mikeymckay
Copy link

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)

@ganeshmogare
Copy link

thanks @mikeymckay , but i have already tried this hack , didn't help :-(

@mikeymckay
Copy link

mikeymckay commented Sep 19, 2018 via email

@brodybits
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants