This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Collecting more frequently
- To: amylaar at cygnus dot co dot uk
- Subject: Re: Collecting more frequently
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Fri, 17 Mar 2000 17:34:33 -0800
- Cc: mrs at windriver dot com, gcc at gcc dot gnu dot org, martin at loewis dot home dot cs dot tu-berlin dot de
- Organization: CodeSourcery, LLC
- References: <200003172349.PAA24733@kankakee.wrs.com><200003180113.BAA26696@phal.cygnus.co.uk>
>>>>> "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