> On Dec 15, 2017, at 8:30 AM, 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?
On most operating systems, the kernel will use virtual memory, so part of the table’s address space will get swapped out to disk. Everything will work the same, just slower. Beyond that, if the size starts to get ridiculous, the effects vary by OS. The OS might kill your process for using too much memory (Linux), or when the swap fills up the disk the OS may suspend your process and put up alerts telling you space is low (Mac OS). Mobile OS’s are different. I can’t speak for Android, but iOS does not use backing store / swap space. If your process uses too much RAM the OS will first send it a warning notification by IPC telling it to free memory, and if that doesn’t help it will kill the process. More relevant to SQLite: if you’re creating a very large database, I don’t think it makes sense to create it in-memory, for the above reasons. Put it in some temporary directory instead, and delete it when you’re done with it. —Jens _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users