Mail Archives: djgpp/2000/08/16/20:45:23
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 -