storesafe / cordova-sqlcipher-adapter

A Cordova/PhoneGap plugin to create and access encrypted databases on Android, iOS, and Windows with API similar to HTML5/Web SQL API
Other
89 stars 55 forks source link

Memory Leak on iOS #86

Closed kyoryud3v closed 4 years ago

kyoryud3v commented 5 years ago

Issue

Persistent memory leaks found on iOS. Please see below:

3 4

Though I've yet to explicitly invoke a database close operation, the app also doesn't invoke any database delete operation, hence I'm not sure if the above is related to:

When a database is opened and deleted without closing, the iOS/macOS platform version is known to leak resources.

Environment

cordova-sqlcipher-adapter: 0.3.0 ionic framework: 3.9.5

brodycj commented 5 years ago

SQLCipher which is based on SQLite will reserve memory resources every time the application opens a database connection. Under normal usage, I would expect most apps to do this a very limited number of times, which should keep the impact of this resource usage very limited.

Also, SQLite and SQLCipher were designed to release all resources whenever the application closes the database connection.

I would only expect this to be a valid issue in case both of the following conditions can be demonstrated:

kyoryud3v commented 5 years ago

I will check if manually closing the database connection fixes the memory leak incurred, then evaluate the need for manually managing the connection.

garryalfa commented 5 years ago

hi @kyoryud3v , is there any update on this? i also have same issue for memory leak in ios 12

kyoryud3v commented 4 years ago

@garryalfa sorry for the very late reply, but we have not fixed this yet. Since we already upgraded to ionic4, we'll just do another batch of tests and assess if this will still persist.

I'm closing this for now. Thank you.