Memory allocation problems ?

Mukund Seshadri mukund at WPI.EDU
Mon Aug 12 15:44:15 EDT 2002


Yup, I get that part .. but in the GASteadyState::step function I don't
find the instruction that actually deletes the items in tmpPop. So the
tree I construct using GATreeGenome<T> doesn't get destroyed and memory
leaks.

On Mon, 12 Aug 2002, Piet Kerckhove wrote:

> The steadystateGA inserts the offspring into the existing parentpopulation
> then deletes the worst individuals till the popsize equals the given popsize
> parameter.
> Hopefully this explains something...
>
> Quoting Mukund Seshadri <mukund at WPI.EDU>:
>
> >
> > I'm using a ptr to an object in a GATreeGenome object and I'm having a
> > memory leak. Now ideally I should have the ptr enclosed in an object that
> > does all the checking and frees the  memory when appropriate but having
> > already commited myself to the simple pointer, I was wondering if I had to
> > rewrite the program with a pointer class or maybe I could call an
> > appropriate destructor.
> >
> > So I declared a GATreeGenome<MyNodePointer>::~GATreeGenome destructor but
> > I find its not getting called.
> >
> > My program calls ga.step (for the GASStateGA) and I notice that the tmpPop
> > is just replaced .. should it also be calling a delete or does that
> > happens elsewhere ? Did I miss something ?
> >
> > Thanks.
> > -Mukund Seshadri
> >
> >
> > _______________________________________________
> > galib mailing list
> > galib at mit.edu
> > http://lancet.mit.edu/mailman/listinfo/galib
> >
>
>
> --
> piet.kerckhove at rug.ac.be
> _______________________________________________
> galib mailing list
> galib at mit.edu
> http://lancet.mit.edu/mailman/listinfo/galib
>





More information about the galib mailing list