Collecting more frequently
Mark Mitchell
mark@codesourcery.com
Fri Mar 17 17:27:00 GMT 2000
>>>>> "Joern" == Joern Rennecke <amylaar@cygnus.co.uk> writes:
>> 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.
Joern> I would rather prefer an heuristic that looks at the ratio
Joern> of new memory allocated to total memory allocated.
We already do this. Look at ggc_collect for details.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
More information about the Gcc
mailing list