Date: Wed, 15 Oct 1997 13:15:12 +0200 (IST) From: Eli Zaretskii To: "Salvador Eduardo Tropea (SET)" cc: djgpp AT delorie DOT com Subject: Re: GCC uses A LOT of memory to parse static arrays In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Tue, 14 Oct 1997, Salvador Eduardo Tropea (SET) wrote: > Data type: unsigned chars > Size of the array: 182,520 bytes > Data memory used by GCC (2.7.2.1): 37,306,480 > .o file generated: 182,895 bytes As I already told in this thread, using unsigned ints instead of unsigned chars will allow you to reduce the dimension of the array by a factor of 4, with similar four-fold reduction of the memory requested by GCC, but still initialize 182,895 bytes of data. > I got "out of virtual"!!!!!, perhaps that isn't very important because you > don't know what go32-v2 reports in my machine: > > DPMI memory available: 27435 Kb > DPMI swap space available: 130389 Kb > > So 128Mb is not enough!! Not so quick, please. Did you use CWSDPMI as your DPMI host? If so, you might need to enlarge its internal heap, because the default heap is only enough for about 21MB of memory allocated in small chunks. I bumped the heap to 640 paragraphs (32KB) and got GCC to compile a program with a larger array which required more than 60MBytes. Did you try to enlarge the heap? > The conclution is very easy: NEVER use GCC for large static arrays, use AS. I would say: never put such large arrays into the image at all. Use an external file.