User: Password:
|
|
Subscribe / Log in / New account

Memory shortage

Memory shortage

Posted May 17, 2007 14:18 UTC (Thu) by dark (guest, #8483)
In reply to: Critical Vulnerabilities in Samba by tialaramex
Parent article: Critical Vulnerabilities in Samba

One technique of dealing with that is to allocate an emergency reserve of
memory when the program starts up. Then if you run out of memory, start a
graceful shutdown process while allocating from that emergency reserve.

The main difficulty is that library functions won't know about your
reserve. If you're on intimate terms with your malloc implementation, you
can get around that by actually freeing the emergency reserve, and relying
on malloc to keep the memory around and allocate from that space.

Of course, it wouldn't be a good idea for every program to do this. Then
you'd run out of memory. ;)


(Log in to post comments)


Copyright © 2018, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds