简体   繁体   中英

sqlite database memory issue

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM