public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Giovanni Bajo" <rasky@develer.com>
To: "naje" <najeiv@ukr.net>
Cc: <gcc@gcc.gnu.org>
Subject: Re: compiler memory use optimization
Date: Thu, 18 Nov 2004 19:33:00 -0000	[thread overview]
Message-ID: <0e5401c4cd9e$bf2bc4a0$f503030a@mimas> (raw)
In-Reply-To: <E1CUr6T-000KRL-CB@storage.ukr.net>

naje <najeiv@ukr.net> wrote:

> my program use C++ templates vary hard, so i've got much memory spent for
> compilation, and sometimes i've got "virtual memory exhaust" error.
> Is there any way to find out which part of my program is hard to
> compile to optimize it, and is there any methods to optimize memory use in
> gcc? And that kinds of optimizations of my code can i use to optimize
> compilation?

It's not easy to tell because they are mostly ineffeciencies spread across
the whole compiler. Surely we can do nothing without a preprocessed source
code to start with (and we can do nothing for 3.3 anyway -- see below).

> I use gcc3.3 on freebsd 5.2.

The good news is that 3.4 is much better at this on many testcases.
(Un)luckily, it is also much more ISO/ANSI C++ standard compliant, so
upgrading from 3.3 to 3.4 for a large C++ applications could be non-trivial.

I suggest you to try it anyway. You can consult
http://gcc.gnu.org/gcc-3.4/change.html, which contains the most common
problems found when upgrading to 3.4, with examples. After you upgraded, get
back to us and tell us how it behaves. Another good point in upgrading is
that if the problem is still reproducible with 3.4, you can submit a bug
report and we'll look into it. 3.3 is near to dead at this point, so major
work to improve compile time or memory occupaiton is very unlikely on that
branch.
-- 
Giovanni Bajo

  reply	other threads:[~2004-11-18 18:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-18 18:45 naje
2004-11-18 19:33 ` Giovanni Bajo [this message]
2004-11-18 22:30   ` Joe Buck
2004-11-18 22:45 ` Mike Stump
2004-11-21  6:49 Dan Kegel

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='0e5401c4cd9e$bf2bc4a0$f503030a@mimas' \
    --to=rasky@develer.com \
    --cc=gcc@gcc.gnu.org \
    --cc=najeiv@ukr.net \
    /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).