www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/08/16/20:45:23

From: AndrewJ <luminous-is AT REMOVE DOT home DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: checking amount of free memory
Message-ID: <c0dmpsgaj2bue4qiitdpudedev83h7tnfu@4ax.com>
References: <8ndke0$lt8$4 AT info DOT cyf-kr DOT edu DOT pl> <966455601 DOT 744070 AT news DOT l3 DOT wish DOT net>
X-Newsreader: Forte Agent 1.7/32.534
MIME-Version: 1.0
Lines: 46
Date: Thu, 17 Aug 2000 00:43:02 GMT
NNTP-Posting-Host: 24.42.120.18
X-Complaints-To: abuse AT home DOT net
X-Trace: news2.rdc1.on.home.com 966472982 24.42.120.18 (Wed, 16 Aug 2000 17:43:02 PDT)
NNTP-Posting-Date: Wed, 16 Aug 2000 17:43:02 PDT
Organization: Excite AT Home - The Leader in Broadband
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On this day Wed, 16 Aug 2000 21:43:29 +0200, some guy named "Wim Cools"
<wimcools AT wishmail DOT net> wrote:

>
>>Is it posible to check the amount of free memory in DJGPP ? Can You send me
>>a small program that will print
>>amount of free virtual, and free physical memory ?
>
>#include <go32.h>
>#include <stdio.h>
>#include <dpmi.h>

[snip]

Weren't the _go32_ functions replaced with just _dpmi functions?  Or one calls
the other?

>>Why when running in windows Dos-Box my Djgpp program can't use disk space
>to
>>create more virtual memory,
>>when physical memory is full ?
>
>I don't think if this is actually true but I think so:
>
>Windows has a Virtual Memory Manager of it's own. So, if you allocate memory
>and there is no physical memory left, windoze will automaggicly allocate
>more memory by swapping to disk (C:\WINDOWS\WIN386.SWP = Windows' virtual
>memory). So, In a Windoze DOS Box you could say you have almost infinite
>physical memory (of course it's not really infinite but it's very much!). If
>you want to test virtual memory functions in your program you'll have to run
>it in plain DOS or disable Virtual Memory in M$ Windoze.

My Windows swap file is in the root of C:.  But I could have put it on any
read/writeable drive with enough space.

Due to current hardware restrictions, the maximum address space is 4 GB.  Also,
it's not the program itself that makes use of the virtual memory.  The
operating system handles those details (yeah, I know there are exceptions).
Incidently, disabling Virtual Memory in Windows is considered a Bad Thing [tm],
unless you have, say, a gig of RAM or so. ;)

-------
AndrewJ

"This is a wonderful answer.  It's off-topic, it's incorrect, and it doesn't
answer the question." - Richard Heathfield.

- Raw text -


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