delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/18/03:15:09

Date: Thu, 18 Feb 1999 10:12:09 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Stefan Viljoen <rylan AT intekom DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Memory leaks, and allegro
In-Reply-To: <199902172204.RAA21716@delorie.com>
Message-ID: <Pine.SUN.3.91.990218101102.3649L-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Wed, 17 Feb 1999, Stefan Viljoen wrote:

> How can I test for memory leaks in DJGPP programs? Will remaining_physical
> and remaining_virtual work for this?

Using DPMI functions is not a good way of looking for memory leaks.
The main reason for this is that DJGPP never releases any memory to
the DPMI server; any memory that's freed is just added to the free
memory blocks maintained by `malloc', and reused on future calls.

The most effective way to spot memory leaks is to use some debugging
package.  One such package is MSS, it's available from the usual DJGPP
sites as v2tk/mss12.zip.

You didn't tell which version of DJGPP did you use.  If that was 2.01,
I suggest to upgrade to v2.02, where the memory allocation functions
has been rewritten to use memory more efficiently.  For some specific
(but rare) memory-allocation patterns, the functions in v2.01 could
behave as if there were a memory leak where in fact there was none.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019