On Sat, May 03, 2008 at 06:04:16AM -0700, Paul G. Allen wrote:
So, the way Linux does it is not bad at all, but the way programmers fail to initialize the memory as soon as it's allocated *is* bad. Allocate the memory and initialize it when it's allocated, not later on when you *might* use it. That way, it's there up front, before the long computation, and there's no surprises half way through. (This is why the C or C++ compiler warns about uninitialized objects.)
Linux allocated memory is "initialized", at least it will always appear that way as long as there is sufficient memory. Newly allocated memory will always be initialized to zero. The thing is, _all_ memory managers used on linux, including malloc, request memory from the OS in much larger chunks than the user requests. Syscalls are more expensive than manipulating a few pointers, so it's better to reduce the number of syscalls. Most lisp systems request enormous amounts of memory from the system, but only make use of the memory that they need. It's kind of annoying because the virtual memory used isn't meaningful. Clozure Common Lisp requests 512GB, and SBCL requests 8GB. But, configuring the OS to force these allocations to get real memory would prevent either from running. David -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list
