From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-x112e.google.com (mail-yw1-x112e.google.com [IPv6:2607:f8b0:4864:20::112e]) by sourceware.org (Postfix) with ESMTPS id D71E0384D0CD for ; Tue, 15 Nov 2022 01:35:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D71E0384D0CD Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yw1-x112e.google.com with SMTP id 00721157ae682-376596ae449so124056897b3.5 for ; Mon, 14 Nov 2022 17:35:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=/CDG+1+FYiDRGBsp92/jYJjXqb5Uo4jf1k3PiFUYdJc=; b=UeDQg2+O7aN6atRP11UiBd/5RIWbXFRqrv/ze0LAFcaygjHuAn6fEYhGaOJxXAXw2k gPws7CX/gJYzaq3nQoJxL4vMpt23VKlbKKqOVwFt87ugE56au90cB/9X+si6trFik2ex ELz4jCnq897qYhBCOl0oU5F02n6FvDvQ3ZdR7g+VHvxa7LCDh41UUToX890+XOx6hp6g iNlrGdKwvAJu+6XBYz1xrrDOX6CVJ+EpIVtgGNkBm/H8Op8Qa0BucemqgjnYubIB7REN plhzw5/AmOLwwRxBaGWs9RkBJ5sOgtG1agSP5TnVCnkxp2RmVzcwMT5F6EFYtfIOZgUj KR0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/CDG+1+FYiDRGBsp92/jYJjXqb5Uo4jf1k3PiFUYdJc=; b=TF7wXioTMfsP1Xri+AbryudpaHdDJar5rbXMhRNQyrZ81pfFH0lQNiimkQVgc9vbVd gn3AlBnydjRGdeD6DxRMRhr8GL3eJFtBvenWeQxzArwwW4UAal8i/Pvqb2UA4olxeEpS CoVu6YdHmPkgmIaT6K4SHElwRg6GxQArm4xK4XS1RKGnTibMsm7Ked0RNstV2s1/5pJ3 j0wgnrJNOS2hInLCd2lutPM/2AvTORvtD9l0bngA3v+g/ANVpbtFdFJVcsUsZS0tMW7A 7y/UmZIwiRmVDfcF7d2RgutJn6dg+t1CrX/bvntraIFsTu8Yh+nAXIOh918QDLwDebAC 4HQw== X-Gm-Message-State: ANoB5pm75F6J3ZBwQ0A96wbkCHshx22rQbo+S4KOYT15SnTLbLA59KBc AhUBmPD7lN/VPtrlhNNQ0NVVssJflzJ6hthi+MKaeDsKc8k= X-Google-Smtp-Source: AA0mqf5JFzSU0mGFNZGBbijxzUH8mddZIJhESbmWY/QwOtnjFOXmEENPr/gyECI4ChnFz09ghaBcoG18xWmLIrtRpmo= X-Received: by 2002:a81:9297:0:b0:370:547a:9d03 with SMTP id j145-20020a819297000000b00370547a9d03mr16086666ywg.132.1668476110224; Mon, 14 Nov 2022 17:35:10 -0800 (PST) MIME-Version: 1.0 References: <5a0a91a5-fc65-c9e9-89ea-035884b9c867@simark.ca> In-Reply-To: <5a0a91a5-fc65-c9e9-89ea-035884b9c867@simark.ca> From: DeJiang Zhu Date: Tue, 15 Nov 2022 09:34:59 +0800 Message-ID: Subject: Re: memory increased rapidly when adding a break To: Simon Marchi Cc: gdb@sourceware.org Content-Type: multipart/alternative; boundary="000000000000ddc22a05ed785d27" X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --000000000000ddc22a05ed785d27 Content-Type: text/plain; charset="UTF-8" On Mon, Nov 14, 2022 at 10:47 PM Simon Marchi wrote: > > Thanks for your detailed explanation. > > Yes, it's `utility.h:560`, I added this break from vscode. > > It's hard to tell if it's a GDB bug, or it's working as expected, just > that GDB is inefficient. > > If you end up expanding all CUs, it's not unrealistic. I've just ran > gdb on itself, and did "maint expand symtabs" to force the expansion of > all symtabs. htop shows 4.6 GB of virtual memory used. So I can > imagine that for a project 10 times bigger, it can take 10 times more > memory. > > I'm curious, so I built that, but then I'm not sure what to do, how to > reproduce your case. > Thanks! I tried again, it really ended, after 13 minutes. Also, as `top` shows, it takes `30+GB` memory. ``` PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 16357 zhudeji+ 20 0 31.9g 30.5g 7.2g S 0.0 49.0 13:34.93 gdb ``` Here are the steps, after build envoy ``` $ gdb --args ./envoy Reading symbols from ./envoy... (gdb) b utility.h:560 Breakpoint 1 at 0x361130b: utility.h:560. (2 locations) ``` Sorry, I can not reproduce `40+GB` memory again. I tried with vscode again, it also ended, with `30+GB` memory. Maybe I got a mistake, or something other changed. I just `kill -9` before it eats huge memory in the next debugging, after I hit `40+GB` once, since it makes the whole system nearly stuck. I'm so sorry for the wrong info. Thanks a lot again. Also, hope gdb could optimize it if it could be there. --000000000000ddc22a05ed785d27--