lua-users home
lua-l archive

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


> > In my old Pentium II with 256Mb of memory running Linux the process is
> > killed by the OS after a while. Roberto has suggested that it's probably
> > a paging problem.
> 
> Actually "optimistic memory allocation".

Right:

  "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."
  http://ahlamnote.blogspot.com/2007/04/optimistic-memory-allocation-strategy.html