[Info-vax] Running Alpha VMS under the ES40 emulator
Johnny Billquist
bqt at softjar.se
Sun Oct 13 15:00:39 EDT 2013
On 2013-10-13 20:23, David Froble wrote:
> Johnny Billquist wrote:
>
>> Memory usage and allocation patterns in most programs means that it's
>> easy to allocate new chunks of memory, but it is hard to ever return
>> any memory to the OS.
>> The OS never reclaims anything until the program exits. Programs
>> explicitly have to give the memory back to the OS. Normal memory
>> allocation routines don't return any memory to the OS. They keep it
>> around for later. (And because it is damned hard to return the memory.)
>
> I'm going to object to such a statement. Freeing memory is easier than
> acquiring it. Now, determining what can be freed may be a tougher job.
>
> This all goes back to good design and programming practices. I can
> imagine someone programming with no intention of ever freeing memory.
>
> In my database product, memory is acquired for I/O buffers and other
> data structures. When a file is closed, all the memory is returned to
> the OS. It's not rocket science, just good design and coding ...
You misunderstand me. Freeing memory in your code is not a problem.
Releasing memory back to the OS is a different thing, and much harder.
And unless you write your own memory allocation routines, you are most
likely *not* returning the memory to the OS when you close a file.
Calling free (or delete of you are using C++) does not return memory to
the OS. If you think it does, you need to refresh how memory handling
routines in libraries work.
Johnny
--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: bqt at softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol
More information about the Info-vax
mailing list