| www.delorie.com/djgpp/mail-archives/browse.cgi | search |
| From: | Elliott Oti <e DOT oti AT stud DOT warande DOT ruu DOT nl> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: Available memory |
| Date: | Sat, 16 Nov 1996 23:25:23 -0800 |
| Organization: | Academic Computer Centre Utrecht, (ACCU) |
| Lines: | 25 |
| Message-ID: | <328EBDE3.389@stud.warande.ruu.nl> |
| References: | <malyonE0zJMx DOT MJ AT netcom DOT com> <328E4B2C DOT 4E23 AT cornell DOT edu> |
| NNTP-Posting-Host: | warande1078.warande.ruu.nl |
| Mime-Version: | 1.0 |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
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
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |