public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tomas Kalibera <kalibera@cs.purdue.edu>
To: Ian Lance Taylor <iant@google.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: Can GCC use more than 4G while compiling ?
Date: Thu, 14 Feb 2008 05:19:00 -0000	[thread overview]
Message-ID: <47B3CF54.4060904@cs.purdue.edu> (raw)
In-Reply-To: <m3ejbgl2cg.fsf@localhost.localdomain>


Ian Lance Taylor wrote:
> Tomas Kalibera <kalibera@cs.purdue.edu> writes:
>
>   
>> GCC runs out of memory while compiling my very large generated source
>> file. Although I have x86_64 with more than 4G of RAM, it seems that
>> GCC only uses something less than 4G. Is there a way to allow GCC to
>> use more ? Something like ggc-heap-size...
>>
>> I'm using GCC 4.2.3, compiled from sources, gcc binary is a 64-bit
>> executable.
>>     
>
> What is the exact error message?  Are all the compiler binaries 64-bit
> executables?
>   
- "virtual memory exhausted: Cannot allocate memory"
- yes, I re-checked all binaries are 64-bit

I'm now trying my luck with

"--param ggc-min-expand=0 --param ggc-min-heapsize=4096"

Compilation is now by orders of magnitude slower, it's been already 
compiling the single file for 6 hours, I don't know how far it got.

The machine has 6G of RAM + 16G of swap and I can malloc more than 4G in 
a test application.
> gcc should not run out of memory until malloc or mmap fail to allocate
> any more memory.  There is no maximum heap size.  gcc's garbage
> collector doesn't run at arbitrary times; in particular it doesn't run
> when there is an allocation failure, nor when the heap reaches a
> certain size.
>   
OK, and there is not any special option needed when compiling the gcc 
compiler ?
I compiled with

Target: x86_64-pc-linux-gnu
Configured with: ./configure 
 --prefix=my_directory
 --host=x86_64-pc-linux-gnu 
 --build=x86_64-pc-linux-gnu 
 --disable-altivec 
 --enable-nls 
 --with-system-zlib 
 --enable-multilib 
 --enable-languages=c,c++ 
 --enable-shared 
 --enable-threads=posix 
 --enable-__cxa_atexit 
 --enable-clocale=gnu 
 --enable-mpfr
Thread model: posix
gcc version 4.2.3


Thanks, Tomas
> Ian
>   

  reply	other threads:[~2008-02-14  5:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-13 23:07 Tomas Kalibera
2008-02-14  2:06 ` Ian Lance Taylor
2008-02-14  5:19   ` Tomas Kalibera [this message]
2008-02-14  5:52     ` Ian Lance Taylor
2008-02-15  0:04       ` Tomas Kalibera

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=47B3CF54.4060904@cs.purdue.edu \
    --to=kalibera@cs.purdue.edu \
    --cc=gcc-help@gcc.gnu.org \
    --cc=iant@google.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).