Your guess is wrong. "pragma cache_size=2000" will limit the internal page cache to 2000 PAGES (of whatever page size the db file has) PER OPEN FILE. To set a limit of 2000kBytes PER OPEN FILE, use "pragma cache_size=-2000". The page cache is process private memory. Whatever portion is actually loaded into main memory (the RSS) counts towards PSS.
"pragma mmap_size=N" will limit the number of bytes that will be mapped into memory PER OPEN FILE. Memory mapped files may be shared between processes. Note that each process gets to determine which part(s) of a file it wants to map. Whatever portion of the file is actually loaded into main memory (the RSS) counts towards the PSS of all connected processes, divided by the number of processes sharing that specific page (on a page per page basis). If you are running only 1 process AND it has page faulted the whole mmap segment into main memory, all of that counts towards PSS. If you are running 2 processes AND they have mmaped the same region of the same file AND they have page faulted the whole segment into main memory, each process is held accountable for HALF of that size. Reducing PSS via mmap is only possible if you are runnning multiple copies of the same application against the same db file. There is no way to directly influence the PSS of a process, since that partly depends on ALL of the other processes. -----Ursprüngliche Nachricht----- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Nick Gesendet: Mittwoch, 11. April 2018 08:52 An: sqlite-users@mailinglists.sqlite.org Betreff: [EXTERNAL] [sqlite] Does mmap increase PSS? Hi, I guess that "cache_size=2000" means PSS of my process will always less than 2M. But, when I use PRAMGA mmap_size to enable mmap, I found the PSS of my process will almost the same as my db. Is that correct? -- Sent from: http://sqlite.1065341.n5.nabble.com/ _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users ___________________________________________ Gunter Hick | Software Engineer | Scientific Games International GmbH | Klitschgasse 2-4, A-1130 Vienna | FN 157284 a, HG Wien, DVR: 0430013 | (O) +43 1 80100 - 0 May be privileged. May be confidential. Please delete if not the addressee. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users