From: G DOT DegliEsposti AT ads DOT it To: djgpp AT delorie DOT com Message-ID: Date: Wed, 4 Feb 1998 10:00:04 +0100 Subject: Re: Re: Memory usage tracking Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Precedence: bulk > Are there any methods to check the memory amount allocated by my > program? Under DJGPP/CWSDPMI. > > It would be nice to be able to check the memory usage with a single > keypress inside my program. > > This would help a lot while developing some programs which > allocate/free mem a lot. I do not know methods wich are specific to djgpp/cwsdpmi (maybe there is some __dpmi_get_allocated_memory() or something like that :-) A very portable way is to write some wrapper functions to malloc() free() and other functions like these. Your wrapper functions can keep track of the memory allocated and deallocated and you can get the value every time you need it. Of course you have to substitute throughout your program all instances of malloc() with my_malloc() and so on. ciao Giacomo