Date: Thu, 18 Feb 1999 10:12:09 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Stefan Viljoen cc: djgpp AT delorie DOT com Subject: Re: Memory leaks, and allegro In-Reply-To: <199902172204.RAA21716@delorie.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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.