delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/06/02:48:09

Date: Thu, 6 Aug 1998 09:47:58 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: djgpp AT delorie DOT com
Subject: Re: RHIDE, commandline-line and linking
In-Reply-To: <iCdMCj1ZQ5j2-pn2-8LC4T2in4lch@portX67.lanzen.net>
Message-ID: <Pine.SUN.3.91.980806094733.15220B-100000@is>
MIME-Version: 1.0

On 5 Aug 1998 sl AT psycode DOT com DOT REMOVE_THIS wrote:

> 	I've got a 200k (that includes the 
> header file and the .cc file) library I created and when I compile it,
> it requires 21MB of ram in order to create a 1MB .o file.

I was talking about linking, not compiling.

> What am I doing wrong here?

If you compile a large source file with optimizations, then it is
known that GCC sometimes consumes a lot of memory during
optimization.  21MB isn't too much, btw, I have seen examples of
innocent code which uses much more than that (some of those examples
were posted here in the past).  One particular case is when a program
includes initialization of a large array or data structure.

The best way to avoid this high memory usage is to split the offending
functions into shorter ones.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019