-
-
Notifications
You must be signed in to change notification settings - Fork 30
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 #71
Comments
the only thing that seems to help is to close and reopen the database from time to time. In this case memory isn't freed, but it seems to get reused since after the first iteration consumption stays on a constant level.
|
sqlite3 uses prepared statements. Always. To avoid allocating too many statements, in your example you could use: db.scalar("select padding from foo where id=?", Random.rand(1000)) This will create only 1 statement object (per connection) since the arguments are not part of the statement query. Unless there is another source of the leak I think do it. |
Thanks a lot, works for me (no more leak)! |
grows beyond 32GB of RAM on my machine in a couple of minutes.
For the setup you need:
https://www.sqlite.org/src/file/ext/misc/series.c
https://www.sqlite.org/loadext.html: gcc -g -fPIC -shared series.c -o series.so
save the lines below in setup.sql, then
cat setup.sql | sqlite3 test.db
I use crystal 1.1.1 on Ubuntu 18.04
The text was updated successfully, but these errors were encountered: