Mail Archives: djgpp/1996/11/17/10:05:42
A. Sinan Unur wrote:
>
> Restiana Jade wrote:
> >
> >How can I determine the amount of free physical memory (in bytes) from
> >within a DJGPP program? I've looked at the two memory info structures in dpmi.h, but I can't figure out which of the fields has what I want to know.
>
> how about starting info and checking out the information on the
> following two functions:
> * _go32_dpmi_remaining_physical_memory::
> * _go32_dpmi_remaining_virtual_memory::
>
> sinan.
Actually _go32_dpmi_remaining_physical_memory doesn't include the
amount of memory contained in the internal memory pool. Malloc()ing
and free()ing chunks of memory repeatedly will eventually leave
a large internal pool (about 2.5 times the largest chunk after > 200
iterations) and _go32_dpmi_remaining_physical_memory will
show much less memory available than you actually have. Not a problem
if you have 16Mb and use a couple of mallocs, but if your prog. runs on
a 4 Mb machine and mallocs a lot,_go32_dpmi_remaining_physical_memory
can cause some confusion.
Elliott
- Raw text -