-
-
Notifications
You must be signed in to change notification settings - Fork 73
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 after VACUUM #10
Comments
Thanks for reporting the issue. I will look into it. VACUUM creates a temporary new database file. If the main database is encrypted, a copy of the main codec will be made. Maybe this copy is not freed as it should. I will have to check what's going on. |
If I comment the last sqlite3mcCodeAttach() in sqlite3mcHandleAttachKey (case SQLITE_NULL - which is the case for the ATTACH temp db made during VACUUM), I don't have any leak, and the file is still encrypted after the vacuum... weird... |
The The current implementation does not detect this situation correctly: a codec is allocated and initialized, but not freed. Commenting the call to I will provide a fix within the next few days. |
The VACUUM command attaches a temporary database without using a file name. As a consequence there is no SQLite file handle to which the codec of an encrypted main database file could be attached. This was not properly detected leading to a memory leak.
Commit 2794168 should fix the issue. If no SQLite file handle can be found in function |
Closing... reopen if necessary. |
From my preliminary tests, performing a VACUUM makes a memory leak of the codec instance (65xxx bytes). With no VACUUM (i.e. regular INSERT/UPDATE/SELECT), no memory leak.
I guess there is a missing sqlite3mcCodecFree() call somewhere...
Perhaps the ATTACH statement executed during VACCUM doesn't work as expected.
The text was updated successfully, but these errors were encountered: