Skip to content

Conversation

@ferretwithaberet
Copy link

Adds additional information about MMKV being an in-memory store backed by mmap to avoid confusion. This gives more context for people that do not know what mmap or MMKV are or how they work.
I, personally, made the mistake of persisting tanstack query's cache with maxAge: Infinity to react-native-mmkv, without ever realizing that it is an in-memory store and that I am filling the RAM of my users' devices.

Adds additional information about MMKV being an in-memory store backed by `mmap` to avoid confusion.
This gives more context for people that do not know what `mmap` or `MMKV` are or how they work.
I, personally, made the mistake of persisting tanstack query's cache with `maxAge: Infinity` to `react-native-mmkv`, without ever realizing that it is an in-memory store and that I am filling the RAM of my users' devices.
@XChikuX
Copy link

XChikuX commented Nov 1, 2025

I agree. I didn't know the fetches were happening from RAM. Especially if all data is stored in ram without LRU cache. (not sure if this is how it works)

However, I think your explanation complicates understanding. @ferretwithaberet.

I'd prefer you keep the line:

  • MMKV is an efficient, small mobile key-value storage framework developed by WeChat. See Tencent/MMKV for more information

and add

Stored data is loaded onto memory using mmap and synced with the filesystem for persistence.

As an additional line. Please correct me if I've made any mistakes in understanding.

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

Successfully merging this pull request may close these issues.

2 participants