-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak on execute for allocated Arguments #225
Comments
Argh!! The Looking at both underlying implementations which keep a list of allocated pointers and clear them after freeing them, there's no double-free risk with just removing that guard. Also, |
Fixed in 2.4.2. Thank you very much for the detailed report and analysis! |
Thank you, incredible speed with this. I'm used to large companies where it takes months to even get a bug report reviewed. |
When inserting large amounts of objects, ram usage grows out of control. Attached is an example inserting 250k records and after everything is disposed of, ram usage stays 400 mb higher than starting. This is causing out of memory crashes on Android when attempting to data load records.
Upon researching this, deallocateArguments() in FfiStatmennt doesn't seem to be called.
The only place I can find referencing it is inside FinalizableStatment, and it has a check for _hasAllocatedArguments beforehand, but there is nothing in the code to ever set to that to be true
To further test, I created a fork and forced a call to deallocateArguments and it has fixed the memory leak locally for me, however I don't think I am doing that in the correct place.
Thanks, let me know if there are further things I can provide
Code to reproduce:
The text was updated successfully, but these errors were encountered: