Impact of virtual memory in linux-general Linux technology-Linux programming and kernel information. The following is a detailed description. You may rarely face this situation, but once so, you must know what is wrong: insufficient memory or out-of-memory (OOM ). The result is very typical: you cannot reallocate the memory, and the kernel will kill a task (usually the one running ). Generally, with a large amount of read/write switching, you can see the screen and disk movements.
The following is an implicit question: How much memory do you need to allocate? How much does the operating system allocate to you? The basic reason for OOM is that you apply for more memory than the system can use. I have to say virtual memory, because swap partitions are also included.
Understanding OOM
To get started with OOM, first try the code that will allocate a large amount of memory: