Message-Id: Comments: Authenticated sender is From: "Salvador Eduardo Tropea (SET)" Organization: INTI To: Eli Zaretskii , djgpp AT delorie DOT com Date: Wed, 15 Oct 1997 14:21:53 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: GCC uses A LOT of memory to parse static arrays Precedence: bulk Eli wrote: > 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. Is not the point, what if I need 4 times this size? and isn't very good sujest to tweast the values just to reduce the number of elements. In fact one of the advantages of the way the program uses to generate the array is that you can see the fonts in the array ;-) > > 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? Of course! > 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? Hmmm I don't remmember well by I think I did it a long time ago. And now somebody tested it on UNIX and wasn't able to compile it with 128Mb of memory so I think it won't change the situation. He was able to make it with 256 Mb. > > 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. That's not good for more than one situation and I don't whant to say what the user can or can't do, but how to do the thing. SET ------------------------------------ 0 -------------------------------- Visit my home page: http://www.geocities.com/SiliconValley/Vista/6552/ Salvador Eduardo Tropea (SET). (Electronics Engineer) Alternative e-mail: set-sot AT usa DOT net - ICQ: 2951574 Address: Curapaligue 2124, Caseros, 3 de Febrero Buenos Aires, (1678), ARGENTINA TE: +(541) 759 0013