TryGhost / node-sqlite3

SQLite3 bindings for Node.js
BSD 3-Clause "New" or "Revised" License
6.23k stars 817 forks source link

How can I find where SQLite stores data when using an in-memory database (:memory:)? #1801

Open KaustubhMogha11 opened 2 months ago

KaustubhMogha11 commented 2 months ago

Issue Summary

The memory consumption of a Node.js server process using an SQLite in-memory database decreased from 1.5 GB to 50 MB in Task Manager, while the SQLite database still contains 1 GB of data. The database size was found using this query: SELECT (page_count - freelist_count) * page_size AS size FROM pragma_page_count(), pragma_freelist_count(), pragma_page_size().

Steps to Reproduce

-

Version

5.1.6

Node.js Version

16

How did you install the library?

-

siiky commented 1 month ago

The in-memory DB is not stored. If process memory use dropped, mostly likely your OS is playing tricks. Nothing related to SQLite itself or this library.