Skip to content
Ophir LOJKINE edited this page Jun 12, 2014 · 1 revision

Frequently Asked Questions

(This list is a work-in-progress and is incomplete)

Why does my application crash after opening a few databases?

Most likely your are running out of memory. Make sure to call db.close() after you are done with your database and before opening a new one. Also make sure to free statements with stmnt.free(). sql.js seems to run out of memory after loading about 100MB worth of database(s)(?).

Why do database files in sql.js take so much more memory than other native sqlite solutions?

Due to the nature of web applications, sql.js must have the entire database file in a byte array in its memory.
To avoid excessive memory usage, it is a good idea to split up your databases and tables into separate files, opening and closing them when needed.

If you still really need to use large SQLite files, a server-based solution would probably be better for you.