in reply to Re: Re: Re: Hash Entry Deallocation
in thread Hash Entry Deallocation

No, it isn't quibbling over semantics. Nearly all operating systems have facilities to unmap pages from a process' memory space and give them back to the OS. Not swap them out, not ignore them and let them get compressed, give them back. VMS, Win32, MacOS, OS/3x0 (which is rather older than Unix), AmigaOS, RSTS/E, RSX, RT-11. (I believe TOPS-10 and TOPS-20 did as well, but I'm not positive) Unix was, for quite a while, relatively rare in the multi-user OS realm as a system that wouldn't unmap pages, though the general design of Unix programs minimized the annoyance it caused.

Even still, Most Unix and Unix-like systems have caught up with the '80s and will, in fact, unmap pages, freeing them back to the OS and taking them out of the process' memory space. Perl will give back space to the OS if the OS or C libraries support that and a memory block is unused.

Generally speaking, there's nothing wrong with having a series of discontiguous memory chunks mapped into a process. Happens all the time on many systems, and it works just fine. (Holes in mapped address space actually make a number of things mildly safer, which is also nice)

  • Comment on Re: Re: Re: Re: Hash Entry Deallocation

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Hash Entry Deallocation
by bart (Canon) on Sep 02, 2003 at 14:14 UTC
    I don't know exactly why you mention MacOS... by which I assume you mean pre-OSX. On Macintosh the programs not only can't give back memory to the OS, they can't even receive more memory if they need it. All memory is preallocated to a program when it starts up, and that's all it can get. The Finder (the GUI layer on top of the OS) is the only program not restricted by this rule. AFAIK.

    --
    bart, an old time Mac user

      On OS 9 and before versions of MacOS, you can, in fact, allocate memory outside what is allocated to your program. It's not recommended, as it fragments the remaining memory and can make things problematic for the system (and isn't freed if your program's killed, IIRC, not that killing a program's all that safe under OS 9- anyway) but it's quite doable.