Re: Heaps and Foreigners

From: Duane Rettig (duane_at_franz.com)
Date: 05/05/04


Date: 05 May 2004 11:03:23 -0700

tfb@famine.OCF.Berkeley.EDU (Thomas F. Burdick) writes:

> Tim Bradshaw <tfb@cley.com> writes:
>
> > Of course, applications that cause the machine to run traumatically
> > out of physical backing for memory have problems, and OSs often handle
> > this case badly. But saying that these facilities therefore shouldn't
> > exist is like saying that you should manage memory yourself because
> > GCs have bad edge cases.
>
> But that's not quite what Duane proposed. When I started reading his
> post, I was gonna jump in with an objection, but by the time I got to
> the end of it, I was quite happy with what he was proposing. That
> database could just as well be mapping a gigantic sparse file, but
> only asking for backing on the parts it's using. This would have the
> advantage that anything it thinks it has access to, it actually does,
> and it could sanely recover from out-of-memory conditions, because the
> memory it thinks it has set aside for this purpose is really set aside.

Precisely. I don't think that it's explicit memory management to
demand that every allocation be explicit, even if through a hook.
It would be nice if along with the MAP_NORESERVE flag provided by
solaris, its mmap() also marked the unbacked addresses as no-access,
and also provided a hook function that would be called whenever
those addresses were accessed - a user trap handler, of sorts.
Then, precise knowledge of what kinds of accesses the program wants
to allow could be provided, and error messages could be explicit
if such accesses are not allowed. The default might be to generate
a SEGV, as usual.

-- 
Duane Rettig    duane@franz.com    Franz Inc.  http://www.franz.com/
555 12th St., Suite 1450               http://www.555citycenter.com/
Oakland, Ca. 94607        Phone: (510) 452-2000; Fax: (510) 452-0182   


Relevant Pages

  • Re: Memory management terminology
    ... A page is a range of addresses in virtual memory whose start address ... these pages may or may not have physical backing before the allocation. ... For a page that does not have physical backing before the allocation, ... that that block of memory is adjacent to a free block. ...
    (microsoft.public.vc.language)
  • Re: Memory management terminology
    ... a range of pages is a larger chunk of memory than a single ... For a page that does not have physical backing before the ... always immediately coalesce these two free blocks into one free ... You are confusing OS memory manager and CRT heap manager. ...
    (microsoft.public.vc.language)
  • Re: Memory management terminology
    ... a range of pages is a larger chunk of memory than a single ... For a page that does not have physical backing before the ... always immediately coalesce these two free blocks into one free ... You are confusing OS memory manager and CRT heap manager. ...
    (microsoft.public.vc.language)
  • Memory management terminology
    ... A page is a range of addresses in virtual memory whose start address ... these pages may or may not have physical backing before the allocation. ... For a page that does not have physical backing before the allocation, ... that that block of memory is adjacent to a free block. ...
    (microsoft.public.vc.language)
  • Re: What factors influence required memory alignment?
    ... preventing such alignment on DOUBLE PRECISION operands. ... point values are packed into a single register and/or memory location. ... The ability to trap misaligned accesses was added to various x86 ... Its slightly easier to catch bugs when an odd address read immediately ...
    (comp.arch)