drizzle-team / drizzle-team/drizzle-orm
[BUG]: Memory leaks with sqlite in react native
- Dominant language
- TypeScript
- Stars
- 35.8k
- Forks
- 1.6k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 4
Description
### Report hasn't been filed before.
- [x] I have verified that the bug I'm about to report hasn't been filed before.
### What version of `drizzle-orm` are you using?
0.39.1
### What version of `drizzle-kit` are you using?
0.30.4
### Other packages
expo-sqlite@14.0.6
### Describe the Bug
**The problem:**
I noticed that when using Drizzle ORM in a React Native app, the "native" memory usage in the Android Studio profiler keeps increasing. For example, in my application, I update a single database record every 300ms.
I need to create a React Native application that runs 24/7 on an Android tablet. In my test, after 10 minutes, the "native" memory usage increased by 25MB. Since the application continuously updates data, after one or two days, it consumes all available memory and crashes, which I want to avoid.


**How to reproduce?**
I have created a repository where you can reproduce the issue: [https://github.com/kmichaliq/react-native-memory-usage](https://github.com/kmichaliq/react-native-memory-usage)
After clone repo, install dependencies and run app.
Next, click "Insert new device" few times to add rows to the "devices" table in db.
Then click "Start Loop [UPDATE]" and view the results in Android Studio Profiler.

Contributor guide
Assessment
This issue has not been assessed yet.