# SQLCipher Memory management mechanisms

**URL:** <https://discuss.zetetic.net/t/sqlcipher-memory-management-mechanisms/3748>\
**Category:** SQLCipher\
**Created:** [July 4, 2019, 8:00am UTC](https://discuss.zetetic.net/t/sqlcipher-memory-management-mechanisms/3748 "2019-07-04T08:00:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tahere](https://avatars.discourse-cdn.com/v4/letter/t/87869e/32.png) [@tahere](https://discuss.zetetic.net/u/tahere)\
**Post date:** [July 4, 2019, 8:00am UTC](https://discuss.zetetic.net/t/sqlcipher-memory-management-mechanisms/3748/1 "2019-07-04T08:00:18Z")

</div>

Hi,  
I’m using sqlcipher in an android application. As it is native in android platform, memory management and some security problems related to it should be considered. For the example, Java protects applications from buffer overflow attacks but when using native codes there is no guarantee for that and the native c/c++ codes are responsible for memory management, garbage collection and other related issues. Does sqlcipher consider these issues in its implementation?

Any help is appreciated

---

<div class="post-metadata">

**Author:** ![sjlombardo](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/sjlombardo/32/3_2.png) [@sjlombardo](https://discuss.zetetic.net/u/sjlombardo)\
**Post date:** [July 5, 2019, 2:07pm UTC](https://discuss.zetetic.net/t/sqlcipher-memory-management-mechanisms/3748/2 "2019-07-05T14:07:41Z")

</div>

Yes, SQLCipher handles all memory management for the native portions of the library internally.

---

<div class="post-metadata">

**Author:** ![developernotes](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/developernotes/32/1309_2.png) [@developernotes](https://discuss.zetetic.net/u/developernotes)\
**Post date:** [July 5, 2019, 2:17pm UTC](https://discuss.zetetic.net/t/sqlcipher-memory-management-mechanisms/3748/3 "2019-07-05T14:17:50Z")

</div>

Hello @tahere

Thank you for your interest in SQLCipher. SQLCipher manages resources such as memory allocation through out the library. We maintain a test suite specific to the Android library which not only contains behavior tests, but a performance test which showcases different cursor window allocation strategies, a mechanism used for paging through queried data.

We also make the full source of the SQLCipher for Android library available for review [here](https://github.com/sqlcipher/android-database-sqlcipher) and the underlying [SQLCipher core](https://github.com/sqlcipher/sqlcipher) library as well.

---

<div class="post-metadata">

**Author:** ![tahere](https://avatars.discourse-cdn.com/v4/letter/t/87869e/32.png) [@tahere](https://discuss.zetetic.net/u/tahere)\
**Post date:** [July 6, 2019, 3:56am UTC](https://discuss.zetetic.net/t/sqlcipher-memory-management-mechanisms/3748/4 "2019-07-06T03:56:30Z")

</div>

Great! Thank you so much…
