Open ramirobg94 opened 2 years ago
Does this affect reading the data? Or no?
No, this doesn't affect reading the data. But the amount of storage used in the filesystem grows and grows...
Maybe the problem is how the set is implement into the MMKV library
Its how mmkv is designed and why it is fast because it does not measure and increase file size on each entry but grows exponentially. So 128 to 256 to 512 to 1024 to 2048 and so on. If you need something accurate, it will be slower. So you have to choose what you want, speed or size.
wait, if you do this
MMKV.set('a', 1) MMKV.set('a', 1) MMKV.set('a', 1) MMKV.set('a', 1)
the results should be
'a':1
'a':1
'a':1
'a':1
instead of:
'a':1
How should be invalidated the cache? and how the versioning works?
Can we get some more details about this? I am having the same issue, which makes this lib pretty much useless. I am using it with react-navigation state persistence, which stores the current navigation stack in mmkv for every screen change (so the user returns back to it after app restart). Within minutes my storage has grown to 50mb usage.
Its how mmkv is designed and why it is fast because it does not measure and increase file size on each entry but grows exponentially. So 128 to 256 to 512 to 1024 to 2048 and so on. If you need something accurate, it will be slower. So you have to choose what you want, speed or size.
In your opinion what's the best option if size is a concern?
does someone have a sample repo to see this?
Hey, @ramirobg94 Have you solved this issue?
Describe the bug I'm facing a problem with redux-persist that can cause a memory and storage leak
Every time a new redux-persist version is created a new key:value pair is stored in the file system.
For example, I have a file with 143 versions, so the size should be 143 times smaller:
As you can see in the image I took the file from the container
A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
Expected behavior All the values stored with the same key should be overwritten like map storage.
Platform Information: