public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan Hubicka <hubicka@ucw.cz>
To: Matt Austern <austern@apple.com>
Cc: Zack Weinberg <zack@codesourcery.com>,
	Jan Hubicka <hubicka@ucw.cz>,
	gcc-patches@gcc.gnu.org, stevenb@suse.de, rth@redhat.com
Subject: Re: Better memory statistics, take 2
Date: Thu, 02 Sep 2004 16:47:00 -0000	[thread overview]
Message-ID: <20040902164542.GG22834@atrey.karlin.mff.cuni.cz> (raw)
In-Reply-To: <EEDA016B-FCFC-11D8-B904-000A95BCF344@apple.com>

> On Sep 2, 2004, at 9:23 AM, Zack Weinberg wrote:
> 
> >Jan Hubicka <hubicka@ucw.cz> writes:
> >
> >>Hi,
> >>here is updated version of patch I sent while reducing memory for GCC
> >>3.4, it is quite usefull now again...
> >>
> >>Hi, this patch improves the per-line statistics by tracking down
> >>each allocated entity to figure out whether it will be freed,
> >>garbage collected or leaked.  To rule out ggc_freed values is pretty
> >>important as these are much cheaper,
> >...
> >
> >Please do timing tests before submitting any changes.  In my
> >experience ggc_free is *not* cheaper, it is by itself such an
> >expensive operation that we don't actually gain anything over
> >letting the garbage collector do its job.

My experience is that you need to free quite a lot of memory to see gain
(ie you need to avoid at leat one GGC run).  For Gerald's testcase I
actually measured slight change in execution time with both changes (ie
one GGC run, but it is because my memory setup is definitly on the
corner between 22 and 23 GGC runs)

This patch is not adding any ggc_free, just making analysis prettier.  I
have some extra patches dependent on the framework (ie I use it to
detect leaks where we keep pointer to something local accidentally and
it was usefull enought to reduce peak memory usage of combine.c
compilation from 12MB to 2.8MB.)
> 
> What this does mean is that if we know a data structure will be 
> temporary, we shouldn't use ggc_free or ggc_anything.

Yes, where convenient, I am trying to get out of GGC completely.

Honza
> 
> 			--Matt

  reply	other threads:[~2004-09-02 16:45 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-05 18:25 Make per-call statistics to take into account ggc_free Jan Hubicka
2004-03-19  8:14 ` Jan Hubicka
2004-09-02 16:12 ` Better memory statistics, take 2 Jan Hubicka
2004-09-02 16:27   ` Zack Weinberg
2004-09-02 16:45     ` Matt Austern
2004-09-02 16:47       ` Jan Hubicka [this message]
2004-09-02 17:15         ` Zack Weinberg
2004-09-02 17:23           ` Jan Hubicka
2004-09-02 17:28     ` Daniel Jacobowitz
2004-09-02 16:54   ` Jan Hubicka
2004-09-02 17:18     ` Richard Henderson
2021-08-17  9:17     ` Thomas Schwinge
2021-08-17 10:21       ` Richard Biener
2021-08-17 13:27       ` David Malcolm
2021-08-17 19:31         ` Thomas Schwinge
2021-08-18  7:02           ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040902164542.GG22834@atrey.karlin.mff.cuni.cz \
    --to=hubicka@ucw.cz \
    --cc=austern@apple.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rth@redhat.com \
    --cc=stevenb@suse.de \
    --cc=zack@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).