Date: Thu, 6 Aug 1998 09:47:58 +0300 (IDT) From: Eli Zaretskii To: djgpp AT delorie DOT com Subject: Re: RHIDE, commandline-line and linking In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk 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.