sqlite sqlite3_close() does not release the memory acquired -


we trying integrate sqlite in our application , trying populate cache. planning use in memory database. using first time. our application c++ based.

our application interacts master database fetch data , performs numerous operations. these operations concerned 1 table quite huge in size. replicated table in sqlite , following observations:

number of fields: 60 number of records: 1,00,000

as data population starts, memory of application, shoots drastically ~1.4 gb 120mb. @ time our application in idle state , not doing major operations. normally, once operations start, memory utilization shoots up. sqlite in memory db , high memory usage, don’t think able support these many records.

now when close db using sqlite3_close(), memory not released? tried dropping table, still memory remains high? needs done sqlite releases acquired memory , memory of applications comes normal?

forget sqlite part of question issue applies user process under linux.

a process can grow data segment system call brk(2). in principle, process later release memory making appropriate call shrink data segment. in practice, fabulous way create bus errors because hard ensure pointers larger data space never dereferenced.

however virtual memory comes rescue. there difference between size of process , in-core resident set size (sz , rss respectively shown ps -f). processes have memory no being accessed, rss can smaller sz, , processes waiting happen (e.g. inactive getty processes) rss can 0 means whole process address space has been swapped out active programs can use memory.

getting question, don't explain why want use in-memory database, either way run it, table wind on disk either explicitly through sqlite disk-based store or through virtual memory system.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -