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
AsyncStorage Size in the Docs #3387
Comments
@ryanmcdermott - PR welcome! |
@brentvatne Would love to! Do you know if AsyncStorage lacks a storage cap in Android as well? |
@ryanmcdermott - not sure actually, cc @kmagiera |
I believe @andreicoman11 has been changing this recently |
On android we set a limit of 6mb. |
Any reason not to set it to something like 100-500MB? Micro SD cards these days are easily 16-64GB. |
+1 for a bigger default than 6MB |
I think android and iOS deal with this differently. On android, cache information should not be stored in databases, but in files in designated cache folders which can then be cleaned up when necessary. Databases should be used to store information that is absolutely necessary for the app, information that cannot be automatically reclaimed by the system. |
I think this is still relevant. |
Could we have bigger size of async storage? Or at least make it configurable? 6mb is kind of nothing for modern phones. |
You can set the maximum size of the database via |
@andreicoman11 can you please give some advice as to where should I call |
@andreicoman11 Why shouldn't apps store more than 6MB in their local databases? Seems true under the assumption of relatively light clients. P2P applications, however, might well expect to save more than 6MB worth of data (as one example) |
BTW @kapv89, I haven't tried this out, but looks like you can call |
Currently, there's no documentation on the default 6MB limit on Android for `AsyncStorage`. This pull request adds documentation for iOS and Android size limits, as well as example code to changing the default size limit on Android. This pull request should properly resolve this issue: facebook#3387 (comment)
Hi! I changed the setMaximumSize but still having problems. I get this error: |
@agrass Were you ever able to solve the issue? I have the same error. |
@andreicoman11 @brentvatne Why is wrong to use more than 6mb with AsyncStorage? You mean more than 6mb in one key/value element right? The whole key/values of AsyncStorage together could be greater than that size? Anyone with another solution? because store the data on the disk is a little slow if you need to persist frequently. |
@agrass Did you find out something about the limit? Is it for each key or for all? |
Hi set can anyone help me ? |
@carlosscheffer @KishanIos007 I think that the best solution right now is just to change the code to store less data in one key of AsyncStorage, and instead of that store in different keys/values of AsyncStorage or in the disk. |
Just a quick change that would be great to see in the docs, is to list the size of AsyncStorage. This was answered by @ide in a StackOverflow question: http://stackoverflow.com/questions/32875726/how-large-is-asyncstorage-in-react-native
The text was updated successfully, but these errors were encountered: