Messages in this thread | | | From | "David Schwartz" <> | Subject | RE: Avoiding OOM on overcommit...? | Date | Fri, 24 Mar 2000 15:00:23 -0800 |
| |
> On the other hand, I see several people, some of whom I know are > competent, defending the existing behaviour. > > Methinks not all those folk are clueless. More likely, I've missed > something basic here. Would someone please explain it?
If RAM is full, the kernel cannot page anything in without paging something else out first. Now suppose a process that demand-loaded a shared library suddenly touches a chunk of that library it has never used before. In order to page in that piece of the library, the system must page something else out. If swap is full, it can't page out, so it can't page in. What do you suggest it does other than kill the process?
What pattern of operations resulted in this problem is irrelevant. The case of a 'malloc' followed by later use of the memory is just one of many. Ensuring that the system could never ever get into such a situation would render the system unusable in many common configurations.
There are many operations that require the system to consume more vm/swap -- COW, stack expansion, and so on. Not all of them provide the kernel a clean oppurtunity to return a 'NULL'. The system has to balance all of these requirements.
DS
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |