4.7.2 on Android - Memory usage?

I recently upgraded an Android app to sqlcipher 4.7.2 from 4.6.1.
We were having a very occasional OOM error, so we also enabled large heap in this build.

We’ve found a few small memory leaks, and are not trying to debug what might be causing this to occur, and then I noticed this in the 4.8.0 release notes:

  • Reduces initial memory allocation requirement for private heap
  • Add tracking and debug logging of private heap usage statistics

I’m wondering if this might be what’s pushing more of our users over the edge, memory usage wise, and if it might be worth upgrading to 4.9.0 before we really start dissecting the memory usage and looking for leaks.

As an aside, the github page no longer has releases, and it looks like there’s no v4.8.0 tag (although I could have missed it). Just wondering if ya’ll are aware, and if we should expect no further updates from github?

Hi @mandrachek,

My apologizes, the SQLCipher for Android tag v4.8.0 is now out there, it’s the same as v.4.9.0 for SQLCipher for Android as the client library itself didn’t change with the latest release.

It’s hard to say without a reproduction case, but our recommendation would be to upgrade to 4.9.0 and try to reproduce similar workloads in comparison to your client that would cause issues. You might benefit from capturing a profile [1] to compare between the two builds. Additionally, if you have a Commercial or Enterprise license you can gather further memory and encryption statistics [2] for comparison.

While we do not use GitHub Releases for SQLCipher for Android, we do for SQLCipher core [3]. Changes to the SQLCipher for Android library are noted within our SQLCipher release blog posts which are aggregated here [4].


  1. SQLCipher API - Full Database Encryption PRAGMAs, Functions, and Settings | Zetetic ↩︎

  2. SQLCipher Performance Counters - Low Level Statisticts for Optimization and Tuning | Zetetic ↩︎

  3. Releases · sqlcipher/sqlcipher · GitHub ↩︎

  4. Updates - Zetetic Community Discussion ↩︎

Thanks!

I started over the weekend with Leak Canary and head dumps in AS, and fixed a few leaks. The profiler doesn’t seem to want to work for me - it crashes/locks up Android Studio, so… the usual joys of Android development. :slight_smile: