[Python-ideas] Preventing out of memory conditions

Stephen J. Turnbull stephen at xemacs.org
Wed Jan 2 15:59:29 CET 2013


Max Moroz writes:

 > All I found is this comment in XEmacs documentation about vm-limit.c:
 > http://www.xemacs.org/Documentation/21.5/html/internals_17.html, but
 > I'm not sure if it's XEmacs feature or if malloc itself supports
 > it.

It's an XEmacs feature.  Works for me (but then it would, wouldn't it ;-).

The implementation is just generic C, except for the macros that are
used to access the LISP arena's bounds.  It uses standard functions
like getrlimit where available, otherwise it just uses the end of the
address space to determine the available amount of memory.  I can't
vouch for accuracy or efficiency in determining usage (which is why I
didn't bring it up myself), but there hasn't been a complaint about
its functionality since I've been consistently reading the lists
(1997).

https://bitbucket.org/xemacs/xemacs-beta/src/c65b0329894b09c08423739508d277548a0b1a00/src/vm-limit.c?at=default
https://bitbucket.org/xemacs/xemacs-beta/src/c65b0329894b09c08423739508d277548a0b1a00/src/mem-limits.h?at=default




More information about the Python-ideas mailing list