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

RE: malloc problem





> You only have so much memory to allocate and when you haven't
> got any more the kernel will kill some process to free some
> (I've heard of some kernel setting that doesn't kill on malloc
> but waits until the memory is actually used).

but why wouldnt it be possible in this case to simply return null from
malloc?

and is it possible to setup the memory allocation policy from user space
sothat processes are not killed and malloc just returns NULL?
I saw something for freebsd - the M_WAITOK/NOWAIT flags.. not sure if you
were refering to these....nothing on linux though....

any suggestions?

thanks, 
akshay

> ,
> I'm not sure about how the 2.4 kernel handles fragmentation,
> but I think that if you fragment the memory you will increase
> the possibility that a large malloc will fail.
> 
> Best regards
> /Jonas
>