开发者

sqlite database memory issue

开发者 https://www.devze.com 2023-04-12 19:07 出处:网络
I am trying minimize the memory usage of my sqlite database. Originally, in my Android application, the db was about 400kb, as everything worked fine. The db copied easily from the assets folder for f

I am trying minimize the memory usage of my sqlite database. Originally, in my Android application, the db was about 400kb, as everything worked fine. The db copied easily from the assets folder for first time users. We had to c开发者_运维百科hange some things about the database, and it is now about 850kb. The db does not copy from the assets folder to a device(it works on an emulator). In the new, larger db, I tried changing some of the columns that were text columns into integers and reals(when possible). This did nothing to reduce the size. Any ideas?

Thanks!


The Vacuum command might help. It recreates the database from scratch, eliminating fragmentation and other things bloating your database.


In SQLite once you create a database an certain amount of memory is used. As you keep on increasing the memory it takes from the stack. But it does not free this memory, as its an feature of the SQLite to retain this memory for future use. Use Vaccum to free this memory.

0

精彩评论

暂无评论...
验证码 换一张
取 消