www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/02/07:50:14

From: Shawn Hargreaves <Shawn AT talula DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Memory Eater....
Date: Sat, 28 Jun 1997 11:00:46 +0100
Organization: None
Distribution: world
Message-ID: <T7j3aDAODOtzEwcG@talula.demon.co.uk>
References: <01bc7ff3$d6259920$5514a8c0 AT j DOT downey DOT gnat DOT thezone DOT net>
<01bc80c8$74f29240$5514a8c0 AT j DOT downey DOT gnat DOT thezone DOT net>
NNTP-Posting-Host: talula.demon.co.uk
MIME-Version: 1.0
Lines: 29
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Mike Winsor writes:
>Well, I've fixed something with this.  Now when it loads the maps files it
>eats only 8k once... not 8 every time it loads, just once.  BUT I'm still
>having a nasty problem with the animations being loaded... It seems to EAT
>84k each time it plays... PLEASE I need help with this... Shawn, if you can
>help please do.....

How do you know it's leaking memory? If you are calling the DPMI
functions to query the amount of free memory, the return value is pretty
meaningless because a) physical memory is often only actually allocated
when you use it, so it's possible to call malloc() and not see any
change in the amount of free space, and b) the libc implementation of
free() doesn't return memory to the DPMI server, but stores it in an
internal heap for reuse by subsequent malloc() calls. So the DPMI memory
information calls are not all that useful :-)

If you really are leaking RAM, you have my sympathy, but I'm afraid
there isn't anything I can do about it! Memory allocation bugs can be an
absolute nightmare to locate - you're just going to have to go through
all your code making sure you release everything that you allocate
(including things like destroying any BITMAP objects you create, closing
files, etc). It might be worth trying a debug version of the malloc
library: I've never used one of these myself, but some people swear by
them...


--
Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
Beauty is a French phonetic corruption of a short cloth neck ornament.

- Raw text -


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