lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Luiz Henrique de Figueiredo wrote:
  "We learned that malloc should return NULL in case of out-of-memory.
  However, it is not the case in Linux. By default, Linux uses
  optimistic memory allocation strategy. Under this strategy,
  Linux assumes there always exists free memory. The memory region
  returns by malloc is not actually allocated until the process
  touches the memory region. This means the memory region returns
  by malloc may not be available. In case of out-of-memory, the
  OOM Killer in Linux will pick up one or more process to kill."

The number of things one learns just by reading this list is amazing! Today I've already been surprised twice :-)