linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Holger Kiehl <Holger.Kiehl@dwd.de>
To: Glynn Clements <glynn@gclements.plus.com>
Cc: linux-c-programming@vger.kernel.org
Subject: Re: Where am I using so much memory?
Date: Fri, 27 Jul 2007 13:38:42 +0000 (GMT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0707271333090.17504@praktifix.dwd.de> (raw)
In-Reply-To: <18083.36234.878243.211828@cerise.gclements.plus.com>

On Sun, 22 Jul 2007, Glynn Clements wrote:

>
> Holger Kiehl wrote:
>
>> I am trying to find out why one of my process (written in C) is suddenly
>> using so much memory. Under normal conditions VSZ is 5132 and RSS is 2020.
>> Now after running a view days VSZ is 280896 and RSS is 13700. And it stays
>> at that level, so I assume it must have been in some code pass that is
>> hardly used. The program is large so I am looking for a way to locate
>> the variable that uses the memory with the help of gdb. The process
>> is compiled with debug information (-ggdb3).
>
>> Is there a way that I can find with the help of gdb the variable name that
>> had or still has this 270MB allocated?
>>
>> Or is there some other way to find at which place in the code I am using
>> so much memory?
>
> Try mtrace():
>
Thanks! That helped me find the place. It took a long time, but that
was because the code path that triggered it was hardly taken. But
once it happened it was very easy to find it with mtrace().

Many thanks for the advice!

Holger


      reply	other threads:[~2007-07-27 13:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-22 11:26 Where am I using so much memory? Holger Kiehl
2007-07-22 17:02 ` Glynn Clements
2007-07-27 13:38   ` Holger Kiehl [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=Pine.LNX.4.64.0707271333090.17504@praktifix.dwd.de \
    --to=holger.kiehl@dwd.de \
    --cc=glynn@gclements.plus.com \
    --cc=linux-c-programming@vger.kernel.org \
    /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 NNTP newsgroup(s).