delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/08/30/15:09:43

Date: Tue, 30 Aug 94 11:38:38 EDT
From: peprbv AT cfa0 DOT harvard DOT edu (Bob Babcock)
To: dolan AT fnoc DOT navy DOT mil
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: bugs in exec.c et al
Reply-To: babcock AT cfa DOT harvard DOT edu

> 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019