Thanks for all the replies. I’ve just finished a test on win32. Firstly I tried appending a int64_t to a vector until I got an exception. This happened at i = 60,540,698.
I then created a table in mem with a single integer column and appended values(2<<62) until I got an exception. This happened (‘out of memory’) at i = 102,855,613 although it should be remembered sqlite would be appending a RowID as well as the int64_t value. Is there any easy way of creating a table that will use mem for speed but revert to disc for backup if memory runs out? From: Richard Hipp<mailto:d...@sqlite.org> Sent: 15 December 2017 19:11 To: SQLite mailing list<mailto:sqlite-users@mailinglists.sqlite.org> Subject: Re: [sqlite] What happens if an in memory database runs out of memory On 12/15/17, x <tam118...@hotmail.com> wrote: > Suppose I execute “attach :memory: as mem” and then create a table in mem > that requires more space than the available RAM can hold what will happen? You will get an SQLITE_NOMEM error from SQLite. This is well-tested behavior. You can run tests yourself by compiling with -DSQLITE_ENABLE_MEMSYS5 and then starting the "sqlite3.exe" command-line shell with the "--heap" argument to tell it how much memory to use. Give it a few megabytes. Then start up your in-memory database and fill it up to see what happens. sqlite3 --heap 5MB The --heap option causes the shell to do a single 5MB memory allocation and then divy up that one allocation for all its memory needs. When the 5MB is gone, SQLite is out of memory and will start reporting SQLITE_NOMEM errors. -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users