storesafe / cordova-sqlite-storage-help

Help forum for Cordova sqlite plugin projects
2 stars 1 forks source link

java.lang.OutOfMemoryError - large batches #55

Closed brodycj closed 2 years ago

brodycj commented 6 years ago

To answer the question from litehelpers/Cordova-sqlite-storage#807:

This kind of error on Android is generally due to handling of extremely large batches in JSON, solved by evcore and evplus plugin versions which are available under GPL and commercial license options. Please contact sales@litehelpers.net in case of interest in a commercial license.

The common workaround is to use smaller batches. The disadvantage is that the database may be in a partially populated state in case of a failure if only some of the smaller batches are successful.

markarupert commented 5 years ago

What does "extremely large batches in JSON" mean?

brodycj commented 5 years ago

Extremely large number of SQL statements in a transaction.

As I said before the evcore & evplus plugin versions, which are available under GPL and commercial license options, should resolve this issue.

Actual breaking point was casually measured over 2 years ago by increasing the batch size in my https://github.com/brodybits/Cordova-sqlite-perftest test program. I was able to increase the batch size to the point of crashing on evcore as well, unfortunately cannot recall any exact numbers. I hope to get updated numbers in the next 1-2 months or so.

brodycj commented 2 years ago

I have published evcore, evplus, and evmax plugin versions to support large and extremely large batches on Android, now posted on the website: https://storesafe.io/