AFAICT the showmap program is just a pretty-printer for the /proc/<pid>/smaps 
file on android.

You need to compare three states:

1) before mmap() is called (there should be no section referring to your file)
2) after mmap() is called (the section should be there, but RSS=PSS=0)
3) after the loop (the section should be there and RSS=PSS > 0)

Which length(s) did you try? Perhaps android mmap is trying to be clever and is 
preloading parts of the file (you would see this in state 2).

With respect to PSS, there is no difference between setting the page cache size 
and setting the mmap size to the amount of PSS you are willing to allow for db 
access (instead of the database size). What makes you think that using mmap 
will be superior to using the page cache?

-----Ursprüngliche Nachricht-----
Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im 
Auftrag von Nick
Gesendet: Freitag, 13. April 2018 05:37
An: sqlite-users@mailinglists.sqlite.org
Betreff: Re: [sqlite] [EXTERNAL] Does mmap increase PSS?

OK, I understand.

I ran a simple program to test if mmap will cause the increasing of PSS. But I 
did not find the PSS increase according to showmap:
    addr = (char *)mmap(NULL, length, PROT_READ, MAP_SHARED, fd, 0);
    for(i=0; i<length; i++){
        c = addr[i];
    }
Which make me have a misunderstand that mmap will always not use physical 
memory.

Thus, I enable mmap in my another sqlite program and find the PSS increases 
along with the growing of my db file which makes me confused as 256M PSS is too 
big for my system.

(Still do not understand why my simple test program does not work.)

And I guess there is no way to reduce the PSS of my sqlite program unless 
pragma mmap_size=10M.



--
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

Reply via email to