storesafe/cordova-sqlcipher-adapter

Memory Leak on iOS

kyoryud3v opened this issue · 4 comments

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

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:

  • not all system resources are released when the application closes the database connection;
  • there is a genuine need for an application to frequently open and close database files

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

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

@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.