X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: kantsel AT mail DOT ru (Anthony) Newsgroups: comp.os.msdos.djgpp Subject: Re: How can I monitor the amount of free RAM? Date: 20 Mar 2004 07:38:50 -0800 Organization: http://groups.google.com Lines: 20 Message-ID: <16f148d8.0403200738.6034bc04@posting.google.com> References: <200403191751 DOT i2JHp99L022683 AT envy DOT delorie DOT com> NNTP-Posting-Host: 62.118.130.30 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1079797131 21400 127.0.0.1 (20 Mar 2004 15:38:51 GMT) X-Complaints-To: groups-abuse AT google DOT com NNTP-Posting-Date: Sat, 20 Mar 2004 15:38:51 +0000 (UTC) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com DJ Delorie wrote in message news:<200403191751 DOT i2JHp99L022683 AT envy DOT delorie DOT com>... > > 1. What memory should I monitor (DOS (below 1MB), upper,...) > > Virtual. > > > 2. How can do that? > > You don't want to monitor free memory, you want to monitor *used* > memory (other things on the computer might use memory too). Most > programs can use the sbrk(0) call to ask libc where the top of your > memory is. If it doesn't change, you're not asking for more memory. > > The exception is if you choose the "non-moving sbrk" option (nearptr, > DMA, etc need this) in which case your memory range is discontiguous > and sbrk() moves all over the place during allocation. But at least > you can tell if it changes *at all*. Thanks, I'll use it. But sill, if I want to know how much memory do I have left, how can I? Anthony