Eduardo A. Bustamante López wrote: > Alfred Baroti wrote: > > Hi, > > I found this from long long time ago. > > Is this a serious bug? > [...] > > This is not a serious bug at all. It's just a memory allocation failure.
Agreed. Not a bug at all. > You can see that the brk() system call actually succeeds. If you are running under the Linux kernel in the default configuration then memory overcommit is enabled. $ sysctl vm.overcommit_memory With overcommit enabled brk(), and malloc(), will always succeed even if there isn't really enough memory. Neither will fork(). It doesn't mean there actually is that much memory available. Later if the kernel runs out of memory to implement the needs then it will fail and trigger the OOM Out Of Memory Killer to virtually kill -9 processes until enough memory is freed up to balance the books. Processes killed by the OOM have no opportunity to clean up or log anything. Or vm.overcommit_memory can be configured the traditional Unix way where enough virtual memory needs to exist or malloc() and fork() will fail. IMNHO overcommit off is the best way for enterprise servers. However overcommit on is convenient for laptops. Bob