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

Bug#247300: libc6: malloc() never fails on 2.4 kernels, making processes crash



On 2004-05-09 14:16:13 -0000, wg@malloc.de wrote:
> > > In general, if you want malloc to return NULL on Linux in a controlled
> > > way, the best advice is to use "ulimit -v" IMHO.
> > 
> > No, this is really a very bad idea, as this would limit the virtual
> > memory, instead of checks being done dynamically.
> 
> Oh, so you're adding/removing physical memory dynamically?

No. I don't see why you ask this. In my documentation, ulimit sets
a limit for the *current* process, not for the whole system. If you
have a solution with ulimit -v (that won't set more limitation than
the free memory), then I would be interested...

> > And the memory will quickly be exhausted.
> 
> Well, either live with that or add sufficient swap space.

Wrong remark. Solaris behaves correctly, for instance (i.e. if there
is no memory left, malloc() returns 0, without needing to set limits
on processes).

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% validated (X)HTML - Acorn / RISC OS / ARM, free software, YP17,
Championnat International des Jeux Mathématiques et Logiques, etc.
Work: CR INRIA - computer arithmetic / SPACES project at LORIA



Reply to: