From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mta-p6.oit.umn.edu (mta-p6.oit.umn.edu [134.84.196.206]) by sourceware.org (Postfix) with ESMTPS id 4E5CE385DC05 for ; Sat, 11 Apr 2020 21:31:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4E5CE385DC05 Received: from localhost (unknown [127.0.0.1]) by mta-p6.oit.umn.edu (Postfix) with ESMTP id 4907NX6DLnz9vFJP for ; Sat, 11 Apr 2020 21:31:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at umn.edu Received: from mta-p6.oit.umn.edu ([127.0.0.1]) by localhost (mta-p6.oit.umn.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id i1uUoP9_DUOr for ; Sat, 11 Apr 2020 16:31:08 -0500 (CDT) Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mta-p6.oit.umn.edu (Postfix) with ESMTPS id 4907NX52y5z9vFJ6 for ; Sat, 11 Apr 2020 16:31:08 -0500 (CDT) Received: by mail-qv1-f69.google.com with SMTP id c3so4649686qvi.10 for ; Sat, 11 Apr 2020 14:31:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=OizzfI4pAsPupkskliu0mSUfWcDwrCen6L0M2IyPnV8=; b=hm0Niok2bus4mDAdvzkGWHEzJVxeVpfZRNXJ/cITnJcFeM9HfafXtRfucVvNpNfZH2 ZkjGpYaFRwhW7S6v/EXQX3FUdx3cLt32bOaRtG4MGlTB+4/WHSLo7t2IKvu4y9V6Pra2 ejGkkbtSqUKusfRttIE3wPW6ggfVOKSP1TFwLE7TwoOl/QbdD6q8ojj9EBScCwlc6psT wWMy7jrnQEHDKLNP2Wpg40enG+DNqvYmpS3I++gTxO8S7mY+QADxwr7AkuOjflmnjwD+ RMrVRbLALPwntDk5kLCFAJC5JS9BOF0OMYVccL+Ow/otzmku4RKzaYvue/0e1vLX+kBZ 1grw== X-Gm-Message-State: AGi0PuYYsbXSQQFt/nV2SkbnqFzUtMdDBtLyYRt4wS4B9XuUDF/Cu4iw F+M/nmmVi6wICOuwr3zqgfXnjQrDpmHA/djkhMoVduElbdzembLhukaQXKGmhm1OjdT8bABd3/9 qQdwuKxyRKjpusJNMfg== X-Received: by 2002:ac8:2baa:: with SMTP id m39mr5102105qtm.208.1586640668154; Sat, 11 Apr 2020 14:31:08 -0700 (PDT) X-Google-Smtp-Source: APiQypIzRf3bnsL57QSAul0GI1cAgDOj+6bNSzLBGAVuDfELHfpSFb6NfEsz/4zB7o9duHnn2qbkig== X-Received: by 2002:ac8:2baa:: with SMTP id m39mr5102098qtm.208.1586640667901; Sat, 11 Apr 2020 14:31:07 -0700 (PDT) Received: from ?IPv6:2601:449:8301:520e:6814:604e:3ced:273b? ([2601:449:8301:520e:6814:604e:3ced:273b]) by smtp.gmail.com with ESMTPSA id u26sm4291165qku.54.2020.04.11.14.31.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 11 Apr 2020 14:31:07 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: "relliott@umn.edu" Mime-Version: 1.0 (1.0) Subject: =?utf-8?Q?Re:_High_memory_usage_compiling_large_=E2=80=98xxd_-i?= =?utf-8?Q?=E2=80=99_output?= Date: Sat, 11 Apr 2020 16:31:05 -0500 Message-Id: <3F1B5DA6-7224-4431-8070-123D18B69B3C@umn.edu> References: Cc: gcc-help In-Reply-To: To: Jonathan Wakely X-Mailer: iPad Mail (17E262) X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2020 21:31:19 -0000 Hello, Thanks for your reply. I guess I don=E2=80=99t 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 t= he parsing process/requirements I=E2=80=99m not appreciating. An example or= explanation would probably help me a lot. Thanks, Ryan=20 > On Apr 11, 2020, at 4:22 PM, Jonathan Wakely wrote= : >=20 > =EF=BB=BFOn Sat, 11 Apr 2020 at 21:04, relliott--- via Gcc-help > wrote: >>=20 >> Hello, >>=20 >> I=E2=80=99m seeing gcc memory usage exceed 15GB when compiling a source f= ile generated from the command: >>=20 >> % xxd -i file.txt >>=20 >> where =E2=80=98file.txt=E2=80=99 is a 170MB file. >>=20 >> Is there a way to avoid this high memory usage? Can anyone explain why i= t occurs? >=20 > Because the compiler is parsing an array initializer with millions of elem= ents.