www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/08/29/10:17:32

Date: Tue, 29 Aug 1995 15:11:33 +0200 (MET DST)
From: Davide Rossi <rossi AT cs DOT unibo DOT it>
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: v2 memory crazyness


On Mon, 28 Aug 1995, DJ Delorie wrote:

> 
> > this really looks like a big bug somewhere: compile the following code and
> > you'll se how v2 eats memory. Nope, it is not a malloc trouble: you can
> > obtain the same using new/delete.
> 
> Not a bug, just a poor interaction between malloc and your program.
> You're (intentionally or otherwise) forcing malloc to ask for more
> system memory each time, because each size is in a different hash
> bucket (or something like that).
> 
Hey but this program eats 18mb of memory in 10 or so iterations!!!!
It is not just question of leaving a bucket (also because I free each block
before asking for a new one).
Since I'm on a sun now I can't verify but I'll check to see if the trouble
is still up with fixed memory sizes. I think so because I have the same
problem with a real application (my picture viewer) that (of course)
allocate and free big chuncks of memory...

Ciao,
	Davide.

- Raw text -


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