Re: High memory usage compiling large ‘xxd -i’ output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

Thanks for your reply.  I guess I don’t understand why this requires so much memory all at once.  Is it not possible to write to the object file as the initializer is parsed?  I feel like there is some complexity about the parsing process/requirements I’m not appreciating.  An example or explanation would probably help me a lot.

Thanks,

Ryan 

> On Apr 11, 2020, at 4:22 PM, Jonathan Wakely <jwakely.gcc@xxxxxxxxx> wrote:
> 
> On Sat, 11 Apr 2020 at 21:04, relliott--- via Gcc-help
> <gcc-help@xxxxxxxxxxx> wrote:
>> 
>> Hello,
>> 
>> I’m seeing gcc memory usage exceed 15GB when compiling a source file generated from the command:
>> 
>> % xxd -i file.txt
>> 
>> where ‘file.txt’ is a 170MB file.
>> 
>> Is there a way to avoid this high memory usage?  Can anyone explain why it occurs?
> 
> Because the compiler is parsing an array initializer with millions of elements.




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux