-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
OutOfMemoryError: Out of Memory #387
Comments
sembast is defintely not memory friendly - see recommendations -, however some things could be done on my side to improve it. Do you have more context information (platform, size of the database, number of records, does it happen right away or after some time, flutter or dart context, even better if you can share your database to help reproducing and investigation)?. Than you! |
Indeed |
Also I don't know how big are your responses (1K, 100K, 10Mb) but if too big, sembast might not be the best solution here.
|
(and the compact operation could also be optimized as it doubled the memory usage during the operation, I would look into that) |
Thanks for quick reply. the responses are less than 10 KB, and I have cached around 20 network requests. they will be overwritten by new responses so the size of cache will be less than 50Kb at max. |
Indeed that is not a lot. Do you confirm that you don't have more than 20 different url (exactly the same as each url will create a new entry, changing a parameter will change the url) and are you able to share a database I can look at? |
Ohhh, in that case can be many, some urls have query parameters so can cause new record. I try to share a local db from simulator. |
here you are: the db size 36 Mb with 150 records! |
Indeed this is not in the recommended usage as most of the records are more than 500KB in a json format. I have slightly improve memory usage in compact in sembast in 3.7.3+3 just published but I would recommend:
|
OutOfMemoryError: Out of Memory
File "store_impl.dart", in SembastStore.currentRecords
File "store_impl.dart", in SembastStore.forEachRecords
File "store_impl.dart", in SembastStore.txnFindRecords
File "store_ref_impl.dart", in SembastStoreRefExtensionImpl.findImmutableRecords
File "store_ref_impl.dart", in SembastStoreRefExtension.find
The text was updated successfully, but these errors were encountered: