This is the mail archive of the gcc-patches@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: Reducing memory consumption



Martin --
>>>>> "Martin" == Martin v Loewis <martin@loewis.home.cs.tu-berlin.de> writes:

    Martin> It introduces a new trigger function gcc_collect_rarely,
    Martin> which only triggers collection when memory consumption has
    Martin> at least doubled; in the beginning, it even needs to
    Martin> triple until something is done.

I don't think there's any point in that.  Just call the existing
ggc_collect.  We already have enough parameters to tweak: the minimum
size at which to do GC, and the expansion factor.  There's no real
reason to have a different expansion factor in other situations.

Before we get to the next major release, we need to profile, figure
out why things are slower and bigger, and take appropriate action.
I'll bet that GC is not really the cause of either the slowdown or the
size expansion, but we won't know until we profile, and experiment.

That said, your patch is basically a good idea.  Put it in, but
without the new function; just call ggc_collect.  Right now, we do our
first collection at rougly 4MB; it might well be that we should set
this to (say) 16MB instead.  Ideally, lots of small files, especially
in C, would require no collection at all.

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