react-native-mmkv icon indicating copy to clipboard operation
react-native-mmkv copied to clipboard

Possible memory leak

Open arthurgeron-work opened this issue 2 years ago • 1 comments

I'm running some analysis on my business' application and came through this data from xCodes Instrument on Memory Leak analyzer mode: Captura de Tela 2022-05-16 às 19 41 25 It seems like there's a memory leak with mmkv's get function: image

Xcode's Instrment's Profile data: https://drive.google.com/file/d/10TX6kSu9b8Y8jtHkaeLHrFDQeY9ufYWt/view?usp=sharing Currently using [email protected] and [email protected]

arthurgeron-work avatar May 16 '22 23:05 arthurgeron-work

Oh that's interesting! Could you profile if this happens on Android too?

mrousavy avatar May 24 '22 11:05 mrousavy

i got same results on IOS, is it possible to introduce a something like "release memory" function example in FastImage we use FastImage.clearMemoryCache() after the component unmount to clear the image from memory and use the disk cache

alzalabany avatar Oct 07 '22 00:10 alzalabany

Yea I think this is a leak, and adding a clear function is a bit hacky. I'll need to find the root cause for this, but if this is in MMKV's codebase then maybe we should create an issue there?

mrousavy avatar Oct 07 '22 18:10 mrousavy

Possibly related? https://github.com/mrousavy/react-native-mmkv/issues/440

mrousavy avatar Oct 07 '22 18:10 mrousavy

@mrousavy Hi, any updates about this? We are ready to migrate to mmkv but we are worried about this 😿

Nasseratic avatar Feb 01 '23 14:02 Nasseratic

Hey! Sorry I cannot reproduce the issue here and it has been inactive for a while. I am going over issues right now and want to keep the repo clean - so I'm closing this for now, if anyone can post a reproduceable example here I can re-open and take a look :)

mrousavy avatar Jul 17 '23 11:07 mrousavy