Message-Id: <200007021626.TAA08137@alpha.netvision.net.il> Date: Sun, 02 Jul 2000 19:28:30 +0200 To: djgpp AT delorie DOT com X-Mailer: Emacs 20.6 (via feedmail 8.2.emacs20_6 I) and Blat ver 1.8.5b From: "Eli Zaretskii" In-reply-to: <395f5aee.3516835@news.huji.ac.il> Subject: Re: Amount of Memory used by a djgpp program. References: <395f5aee DOT 3516835 AT news DOT huji DOT ac DOT il> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: a AT b DOT com (Hbar) > Newsgroups: comp.os.msdos.djgpp > Date: Sun, 02 Jul 2000 15:13:57 GMT > > Do you know of a way to discover the amount of memory that is used by > a program? Anything like 'redir' which will tell me the peak usage of > memory? It's not easy, unfortunately. You might get some insight into the reasons why isn't this easy if you read Chapter 15 of the DJGPP FAQ list. One possibility to estimate the maximum memory usage is to call sbrk(0) near the beginning of the `main' function and right before you exit; the difference between the two numbers will give an approximation of memory allocated dynamically. If that is not good enough, perhaps you could tell more about why do you need to know the maximum memory usage.