Mail Archives: djgpp/1994/08/30/15:09:43
> Huh? If the allocation only effectively allocates virtual memory, then
> a function named ...remaining_physical_memory should ignore anything
> that is not yet occupying physical memory. Anything else would disobey
> the principle of least astonishment.
One reason for asking about physical memory is to figure out whether or not
you will be swapping to disk. For example, suppose you want to sort
something which may or may not fit in memory. If sorting the whole thing at
once leads to swapping, you might be better off sorting it in pieces and then
merging the pieces. (I've seen sort time jump by a factor of 20 when my
application starts swapping.) If the remaining_physical_memory function
doesn't tell you whether you will swap if you use all your allocated memory,
there is a need for another function which does answer this question. I
suppose this gets more complicated under dpmi where the swapping isn't done
by go32.
- Raw text -