Mail Archives: djgpp/1997/04/14/04:17:56
David Orme wrote:
> I managed to malloc a 128Mb array of ints, and I only have 8Mb of RAM! I was
> wondering if DJGPP double buffers or something I didn't recieve an error or
> a NULL from the malloc command.
"John M. Aldrich" <fighteer AT cs DOT com> replied:-
> This is because under protected mode, you can use hard drive space as
> virtual memory. cwsdpmi, the free DPMI host that comes with the DJGPP
> distribution, allows the use of up to 128 MB of physical memory and 128 MB
> of virtual memory. So as long as you have enough disk space, you can happily
> go ahead and grab that 128 MB array. Of course, when you try to actually
> _use_ it, be prepared to wait a long time. Virtual memory is much slower
> than physical. ;)
As virtual memory is much slower than physical, how can a (program which
keeps on malloc()'ing more store) find when it is starting to need to swop
parts of its heap to disk? Someone told me that DPMI can't directly tell you
how much physical RAM is stil free; but how can the program ask DPMI how much
swopping has happened recently?
- Raw text -