[Gc] Re: Memory leak located!

Bruce Hoult bruce at hoult.org
Mon May 26 20:26:27 PDT 2008


On Tue, May 27, 2008 at 1:42 PM, Hans Boehm <Hans.Boehm at hp.com> wrote:
> I believe the standard requires that ::new be used, but allows subdividing
> large chunks.  I believe that both the original HP and SGI STL divided large
> chunks by default.  It's a lot faster on toy test programs.  It's less clear
> how it impact the performance of real code.

This also makes it very hard to track down memory leaks in non-GC programs.

If you're using a recent GCC (3.4 or later) then you can disable
chunking and force STL to call malloc() for every allocation by
defining the environment variable GLIBCXX_FORCE_NEW.  Some earlier
versions had slightly different methods.


More information about the Gc mailing list