SQLite删除后没有释放内存

前端之家收集整理的这篇文章主要介绍了SQLite删除后没有释放内存前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
英语的借口

我使用sqlite并测试它.插入数百万行以测试速度.并在任何插入后删除行.

但我知道我的数据库大小是33.0 MB …..现在数据库是空的.但磁盘上的大小为33 MB.
为什么?

你能帮助我吗?

解决方法

The VACUUM command rebuilds the entire database. There are several
reasons an application might do this:

Unless sqlite is running in “auto_vacuum=FULL” mode,when a large amount of data is deleted from the database file it leaves behind
empty space,or “free” database pages. This means the database file
might be larger than strictly necessary. Running VACUUM to rebuild the
database reclaims this space and reduces the size of the database
file.

https://www.sqlite.org/lang_vacuum.html

猜你在找的Sqlite相关文章