On Thu, 12 Feb 2009 19:14:44 -0800 (PST), jaya_kumar <jayakumar.ananthakrish...@wipro.com> wrote in General Discussion of SQLite Database <sqlite-users@sqlite.org>:
> >I am trying to find the peak heap usage for creating a table with few entries >and when calculated the peak heap usage increases as the numbers of items >inserted into the table increases. > >Following are the steps done, >1. Table created >2. Table updated by insert statement >3. Query for a single tupple from the table based on a primary key > >Please find below the heap usage when sqlite was operated in file mode, >1k entries - 315 Kb >10k entries - 2.3 Mb >100k entries- 5.7 Mb > >Please find below the heap usage when sqlite was operated in memory mode >(using ":memory:"), >1k entries - 318 Kb >10k entries - 11.6 Mb >100k entries- 29.6 Mb > >I am newbie to SQLite, so please let me know if these figures are expected >for SQLite. In general, yes, they are expected. >Also please let me know why is the heap usage increasing based >on the total number of entries updated to the database? For the file database you see the cache growing. There is a maximum on the cache size, which can be influenced by PRAGMA page_size; PRAGMA default_cache_size; PRAGMA cache_size; Every page in cache has some administrative overhead, so the memory occupied will be more than just page_size * cache_size. For the :memory: database, you see the rows being stored in memory and perhaps also some cache. Obviously, both cases also use some memory to store the datastructure that stores the interpreted schema and housekeeping stuff. >Thanks in advance, >Jai More detail can be found on the site (architecture etc.) and in the (well-documented) source. -- ( Kees Nuyt ) c[_] _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users