Tencent / MMKV

An efficient, small mobile key-value storage framework developed by WeChat. Works on Android, iOS, macOS, Windows, and POSIX.
Other
17.1k stars 1.88k forks source link

<MMKV.cpp:331::loadFromFile> fail to mmap [xxxx], Out of memory #1314

Closed swiftieslizheng closed 1 month ago

swiftieslizheng commented 1 month ago

Note:

发现业务逻辑无法插入,看日志发现这个报错

The language of MMKV

e.g. Java and Kotlin

The version of MMKV

e.g. v1.0.23

The platform of MMKV

e.g. Android

05-25 06:00:41.273 1993 2094 I MMKV : <native-bridge.cpp:101::JNI_OnLoad> current API level = 27 05-25 06:00:41.286 1993 2094 I MMKV : <MMKV.cpp:192::initialize> page size:4096 05-25 06:00:41.287 1993 2094 I MMKV : <MMKV.cpp:206::initializeMMKV> root dir: /data/user/0/com.xtc.datacenter/files/mmkv 05-25 06:00:41.312 1993 1993 E MMKV : <MMKV.cpp:331::loadFromFile> fail to mmap [com.xxx], Out of memory 05-25 06:00:41.312 1993 1993 W MMKV : <MMKV.cpp:385::loadFromFile> [com.xxx] file not valid

swiftieslizheng commented 1 month ago

看了之前的issue,尝试手动插入10M以上value的大数据,未触发该异常

lingol commented 1 month ago

Maybe the device is running out of memory. There's nothing we can do about it, as far as I can see.

swiftieslizheng commented 1 month ago

@lingol 检查了设备并没有存在OOM的情况,还有什么可以排查的方向吗

lingol commented 1 month ago

Your log is somehow missing crucial information about the size of the file.

lingol commented 1 month ago

Closed due to inactive.