[gecode-users] Reporting memory usage

Filip Konvička filip.konvicka at logis.cz
Thu Oct 30 16:41:31 CET 2008


> Regions work as follows: if one has a space one can get a region for 
> that space. One can allocate memory (very very efficiently) from a 
> region. However, the memory will only be freed when the region is 
> destructed. (Actually, what happens there is that all spaces for one 
> thread share a small memory area and that a Region provides access to 
> this shared memory area. If a request cannot be fulfilled from this 
> area, memory will be allocated transparently from the heap). Very simple 
> as you don't have to deallocate to a region, very efficient, and much 
> cleaner than alloca.

Great. So I reckon you can explicitly destroy the region as soon as 
you've finished using it. It'll be great fun using fast_pool_allocator 
on top of Gecode regions :-)

> So, what I would like to ask you guys: would you be willing to
> 
>  - Write stl allocators for both regions and spaces.
> 
>  - Test with your own programs that these allocators work.
> 
>  - Send me a patch for Gecode 3.0.0 so that I can integrate your stuff 
> into the trunk into gecode/support (as a separate file).
> 
>  - Test the stuff again after I integrated.
> 
>  - Negotiate among you who does what.

I'll try to port the code to support Gecode 3.0.0 memory API. It is 
little code so I think it should be fairly easy.

So Gustavo, I propose that you wait for me to do the initial work and 
once I post the new version here you can try it out.

As for testing...hm...I've not upgraded to 3.0 yet, so I don't have much 
to test with ATM. Much of what we have is somehow related to FloatVars, 
which probably don't work with 3.0 yet. The rest is some scheduling 
stuff, so I guess I could run these as we're using some custom data 
structures there (mostly vectors, but maybe also some hashmaps, will 
have to check).

BTW, I have a few more fixes for floatvars regarding memory management, 
as dispose() was not properly called for some branchings etc., so I 
guess I should post (yet) another update.

Cheers,
Filip





More information about the gecode-users mailing list