[Gc] Error in simple GC test

Andrew Haley aph at redhat.com
Sun Apr 22 07:38:49 PDT 2007


Christophe Meessen writes:
 > reHello,
 > 
 > I finally managed to make it collect objects. It simply needs to have
 > enough objects allocated. It also worked with STL vector holding
 > pointers to allocated objects. Very impressive. I thought there was some
 > special allocator to use. Will this be portable to g++ 4.x or should I
 > better do things more explicitly ?
 > 
 > The only thing that still bogs me is that there are 1 or sometime 2
 > objects left. Is this normal ?  If yes, how could I know if this results
 > from a memory leak or if it is just garbage pending to be collected.

You can't.  It's a conservative garbage collector, and there are very
likely to be a few object pointers left in registers.  If you can't
tolerate even a few objects not reclaimed you'll have to use a precise
collector.

Andrew.

-- 
Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, UK
Registered in England and Wales No. 3798903


More information about the Gc mailing list