kelbelj at fel.cvut.cz
Tue May 26 16:36:24 CEST 2009
Hi, finally I found the bug:
in the copy constructor of my propagator, I called SharedArray(int n)
constructor, that allocated each time new memory. I did it only in the
version inherited from NaryPropagator class, which is the reason why the
other version was OK.
Jan Kelbel wrote:
> some months ago I implemented N-ary propagator (it is that edge-finder).
> When I used it to solve larger problem instances, I noticed that it
> consumes memory in rate of about 1MB/s.
> I tested it in Gecode 2.2.0 (where it was even about 3MB/s) and in
> Gecode 3.1.0., using MS Visual C++ 2008.
> This propagator is inherited from class NaryPropagator. In the propagate
> method, there is an array for sorting, which is created using the Region
> When I changed the edge-finder to inherit directly from the class
> Propagator, the growing memory consumption disappeared.
> My question is, are there some rules, what should be implemented in
> propagator inherited from NaryPropagator in order allocate/dealocate
> memory correctly?
> Thank you.
> Regards, Jan
More information about the gecode-users