From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id qFl4COvscmO6iRgAWB0awg (envelope-from ) for ; Mon, 14 Nov 2022 20:35:39 -0500 Received: by simark.ca (Postfix, from userid 112) id 20ABB1E124; Mon, 14 Nov 2022 20:35:39 -0500 (EST) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=EPC4mA/8; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_REPLYTO_END_DIGIT,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 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 A57481E0CB for ; Mon, 14 Nov 2022 20:35:38 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D6CF3384D0DD for ; Tue, 15 Nov 2022 01:35:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D6CF3384D0DD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1668476137; bh=rVtHsI1xbke37P3k491hvitcXQ1FfG8b4WZvDMgtmgk=; h=References:In-Reply-To:Date:Subject:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=EPC4mA/8PaHjvGUw89QfK7Xlur8xXGnyCptQXMfymzPjx3c9+WE340DBYOhy5uKny T37GcTCpHQ9TAo0y/XBIg5T/bJ5aoZAZDz8PKNTmpXmfEoQPYEaqsKgvC8XBg4XKLN i5ubrUM5wk85G1iMfIywmC0eb/4/CEDzxYoF4k5k= 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 Received: by mail-yw1-x112e.google.com with SMTP id 00721157ae682-376596ae449so124056897b3.5 for ; Mon, 14 Nov 2022 17:35:10 -0800 (PST) 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> 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: 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: DeJiang Zhu via Gdb Reply-To: DeJiang Zhu Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" 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.