Collecting more frequently

Joern Rennecke amylaar@cygnus.co.uk
Fri Mar 17 17:14:00 GMT 2000


> If you want an easy way to make your change more reasonable, without
> do any real work, you can just collect less often: { static int i; if
> (++i % 20 == 19) gc_collect(); }.  Then you just have to find a
> reasonable N.  Simple, but better than blowing out memory by not
> collecting.

I would rather prefer an heuristic that looks at the ratio of new
memory allocated to total memory allocated.


More information about the Gcc mailing list