Re: Memory allocation errors

Alan Cox (alan@lxorguk.ukuu.org.uk)
Tue, 28 Jan 1997 22:24:53 +0000 (GMT)


> POSIX defines malloc() and free() for user-mode dynamic memory
> allocation and _deallocation_.

It doesn't define it as deallocate to the OS. Deallocating it to the OS
is counterproductive to most paging/virtual memory OS's as it fragments
the virtual address space maps quite badly. For some cases the standard
malloc behaviour is not ideal, but very few. You can use other malloc
libraries for that. Another example where I use different malloc libraries
is the multiuser game I wrote - here because the system malloc has a higher
overhead and I allocate vast numbers of tiny objects. The malloc I use
also knows about the game malloc order and thus optimises for page
locality.

> If memory isn't freed, here's another "denial of services" ...

Not really. The limits on memory size if set sort that.

Alan