From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id oLuiHMUQfWCZaAAAWB0awg (envelope-from ) for ; Mon, 19 Apr 2021 01:10:29 -0400 Received: by simark.ca (Postfix, from userid 112) id 685821F104; Mon, 19 Apr 2021 01:10:29 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 9F15C1E54D for ; Mon, 19 Apr 2021 01:10:28 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4DB203951C66; Mon, 19 Apr 2021 05:10:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4DB203951C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1618809028; bh=QQczPrSLleuOXLot/HFovNZdszYBJI1+NvjjtXUdyxQ=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=wGQ9eIUJbQPXW/1CYR57rNvhXzRmVzKzpEffW9idsnigPLhrlM+MfUC2cuQLYGocE NawzacjNCj1LlH0WhMyZzE3vfJWBMcOeEXm4VW6DeyjW8wsSqzVYeDqYfeQTqaDtIc RBEMBgccd+8RCKy0W2f7Y1EsmG48A2k/pEkfimFM= Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by sourceware.org (Postfix) with ESMTPS id E30E03951C66 for ; Mon, 19 Apr 2021 05:10:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E30E03951C66 Received: by mail-pg1-x52a.google.com with SMTP id d10so23416200pgf.12 for ; Sun, 18 Apr 2021 22:10:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nNxAMgLANnhoz0GdD2zMrAvdcRrNl+22AQCkm1AeYU0=; b=YSdRYwHiJzY88ySJFtDf7jNI9ZhfSZ4AAqfzwk3jVUxIqXKwyCFgauM+B9tScMmMoX bRdTNEOjycIo9DuO+IzP8+Ty6fUmPyXjcHHgPggwdMaMgZUwu3Bd2dBPW6DzUasx87ti DPD8NRJFFf/mu8WHZZNcgc85BjlZKDnbM1vh2ldcQwr95zBXzRQ1XomhclRAjvr7ZPsz 1zWX9+yfpIJK5zArW7EGsyCeUiS9BH1D7/5lmrFHqk/3mWkEFTt+aejkBr6n6xs+F+x9 83GKNbEvyIFCqCpEXxFbWNh+FyiPgG+mwyYhxbd6xA8jBnLCxSgHweBrkUCM8y34NTTF JTyg== X-Gm-Message-State: AOAM531zLMfqr92neCH+X/mn0YHGVXtRTekOUdWpCjfUuEp9tX2NgXyl /GNF3omHS8jb89j3VYQD33aZCE4v/efa5STwu9j0FRksNYo= X-Google-Smtp-Source: ABdhPJxF/1yv+WoTTZoecJYnU+OQhhOg2oSVkqBAXKCNZLO5nRzhGPrPojo6oqMCTj85KVAsqGHxdsEvgGp5v0HQa2E= X-Received: by 2002:a63:43c2:: with SMTP id q185mr9881996pga.41.1618809018073; Sun, 18 Apr 2021 22:10:18 -0700 (PDT) MIME-Version: 1.0 References: <537840208.5089288.1618695042450.ref@mail.yahoo.com> <537840208.5089288.1618695042450@mail.yahoo.com> <95f8714b-a105-8759-dcc4-73122ee8bcf2@yahoo.de> In-Reply-To: Date: Sun, 18 Apr 2021 22:10:07 -0700 Message-ID: Subject: Re: Greatly increased GDB memory and CPU usage with newest embedded ARM toolchain To: "R. Diez" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: David Blaikie via Gdb Reply-To: David Blaikie Cc: "gdb@sourceware.org" Errors-To: gdb-bounces@sourceware.org Sender: "Gdb" Oh, managed to get the lto case to stop & valgrind to log it. Yeah... peaked out over 5GB of memory usage, and: 74.12% (4,372,282,848B) 0x3A4D42: macro_alloc On Sun, Apr 18, 2021 at 9:57 PM David Blaikie wrote: > 4My high water mark reported my massif for the non-lto build was 197MB - > most of that seems to come from decoding the macro information > (dwarf_decode_macros). You could try dropping down from -g3 to -g2 to see > if that helps. (I realize the linux kernel uses a bunch of macros and > benefits from debug info for macros, but it'd at least help isolate the > problem - might help clarify whether the lto case is related or. not) > > On Sun, Apr 18, 2021 at 10:02 AM R. Diez > wrote: > >> >> > [...] >> > & yeah, that does seem like quite a bit of RAM usage for a relatively >> > small amount of debug info. Though I'm not a regular/frequent gdb >> > developer, so I don't have any particular insight there - if no one >> > else chimes in, might be worth running valgrind --tool=massif to get a >> > memory profile, might point to what part of gdb is using all the RAM. >> >> I am worried that I may not be building the toolchain and/or GDB >> correctly. >> >> Could you do the following test for me, just to confirm that you are >> indeed seeing such a high memory consumption? >> >> Could you build GDB 10.1 for ARM? This is how I am configuring it for >> cross-debugging (somewhat simplified): >> >> configure \ >> CFLAGS="-g0 -O3 -flto=9 -march=native" \ >> CXXFLAGS="-g0 -O3 -flto=9 -march=native" \ >> --target=arm-none-eabi >> >> Maybe you want to build it without -O3 and LTO, just using the defaults. >> I have been using those flags for years with previous versions without any >> issues. >> >> Then load one of the .elf files in the attachment like this. There is no >> need to have any ARM CPU available: >> >> ./arm-none-eabi-gdb firmware-debug-non-lto.elf >> >> At this point, GDB should be using less than 15 MiB of RAM. >> >> Now issue this GDB command: >> >> print StartOfUserCode >> >> You should see an output like this: >> >> $1 = {void (void)} 0x866d8 >> >> Did that take more than 1 second? How much RAM is your GDB using now? >> >> If you repeat that with firmware-release-lto.elf , how much memory is >> your GDB using? Be prepared to kill it before it breaks your system though. >> I >> normally kill it after a few seconds when it reaches 2 GiB of RAM. >> >> Thanks in advance, >> rdiez >> >