On Mon, Sep 14, 2009 at 3:53 PM, David Given <[email protected]> wrote:
> > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Dianne Hackborn wrote: > [...] > > If you turn off over-commit, I believe Android won't even boot on a G1, > > because Linux would need to assume that RAM is needed for every mmapped() > > thing, and we run out of it well before the system is fully up. > > Not necessarily --- my intuitive understanding would be that overcommit > would only applies to anonymous storage and not to file storage, as > mmapped() files are backed by actual *files* and not by the pool of swap > pages. (Besides, most of those mmapped() files that Android's using are > read-only and their pages can be silently discarded at any point.) > > That can only be said for files that are mapped read-only. It doesn't apply for anything that is shared copy-on-write (e.g. the Zygote process pages, as well as initial heap) and non-file mappings. This would increase the memory pressure tremendously, given that every VM process has several megabytes of shared copy-on-write pages. > (What we've actually got is a portable API implementation for native > apps. The memory allocation function is defined to return NULL on > allocation failure. It had never occurred to us that *making* it return > NULL on allocation failure could be hard.) > > But it *is* hard to define what "allocation failure" really means if you have memory overcommit enabled. This behaviour also happens on all modern operating systems these days. If you have a swap file, you will simply make it happen later, after much much disk chugging that will make the user totally nuts anyway. - -- > ┌─── dg@cowlark.com ───── http://www.cowlark.com ───── > │ > │ "People who think they know everything really annoy those of us who > │ know we don't." --- Bjarne Stroustrup > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iD8DBQFKrslpf9E0noFvlzgRAuuOAKCAEARJSEPcHxcrEowsxwcMBvkxGwCcC1Jz > kuny8oLQqn1S8mBDmqp9Bwk= > =iCwo > -----END PGP SIGNATURE----- > > > > --~--~---------~--~----~------------~-------~--~----~ unsubscribe: [email protected] website: http://groups.google.com/group/android-porting -~----------~----~----~----~------~----~------~--~---
