public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: DeJiang Zhu <doujiang24@gmail.com>
To: Simon Marchi <simark@simark.ca>
Cc: gdb@sourceware.org
Subject: Re: memory increased rapidly when adding a break
Date: Tue, 15 Nov 2022 09:34:59 +0800	[thread overview]
Message-ID: <CAEZxTmkYpMW3Df5LYWGEZioBzO+M9Me+=c+U0qpGSGq_=UfAzQ@mail.gmail.com> (raw)
In-Reply-To: <5a0a91a5-fc65-c9e9-89ea-035884b9c867@simark.ca>

[-- Attachment #1: Type: text/plain, Size: 1534 bytes --]

On Mon, Nov 14, 2022 at 10:47 PM Simon Marchi <simark@simark.ca> 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.

      reply	other threads:[~2022-11-15  1:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-13 10:01 DeJiang Zhu
2022-11-14  0:26 ` Simon Marchi
2022-11-14  3:58   ` DeJiang Zhu
2022-11-14 14:47     ` Simon Marchi
2022-11-15  1:34       ` DeJiang Zhu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAEZxTmkYpMW3Df5LYWGEZioBzO+M9Me+=c+U0qpGSGq_=UfAzQ@mail.gmail.com' \
    --to=doujiang24@gmail.com \
    --cc=gdb@sourceware.org \
    --cc=simark@simark.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).