I would like to write a program to consume all the memory available to understand the outcome. I\'ve heard that linux starts killing the processes once it is unable to alloc
Have a look at this program. When there is no longer enough memory malloc starts returning 0
#include #include int main() { while(1) { printf("malloc %d\n", (int)malloc(1024*1024)); } return 0; }