This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Collecting more frequently


>>>>> "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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]