9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Russ Cox" <rsc@plan9.bell-labs.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] output of ps(1) memory usage
Date: Thu, 20 Feb 2003 20:10:46 -0500	[thread overview]
Message-ID: <619e37293fcc0c4b393fce088c3ed209@plan9.bell-labs.com> (raw)
In-Reply-To: <fb1108845028587edcc453aa0ff26a26@granite.cias.osakafu-u.ac.jp>

> Is the output of ps(1) on the amount of used memory will not
> shrink natural?

I think you're asking whether the amount of memory
used by a process ever shrinks.  The answer to that is no.

> If so, what is the reason?

Almost all programs allocate memory by increasing
the size of the data segment (see brk(2)).  It's possible
to reduce the size, but first you have to get all the good
data out of the area you're about to give back.  The standard
malloc/free interface does not attempt to give anything back.
It probably should, but it's not much of an issue for us --
once we clear out our memory leaks programs tend to reach
a steady size and then not grow further.

> I'm seeing this for threaded programs such as ame and marsv.

Leak(1) will check a running program for memory leaks,
in case you are concerned about that.

Russ



  reply	other threads:[~2003-02-21  1:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-21  0:51 okamoto
2003-02-21  1:10 ` Russ Cox [this message]
2003-02-21  1:18   ` rob pike, esq.
2003-02-21  2:23 ` David Presotto
2003-02-21  1:55 okamoto
2003-02-21  2:06 okamoto
2003-02-21  2:08 ` Russ Cox
     [not found] <uncover@beat.cc.titech.ac.jp>
2003-02-21  2:27 ` YAMANASHI Takeshi
2003-02-21  2:30   ` Russ Cox
2003-02-21  2:42   ` Scott Schwartz
2003-02-21  2:34 okamoto
2003-02-21  2:37 ` Russ Cox
2003-02-21  2:43 David Presotto
2003-02-21  3:09 okamoto
2003-02-21  5:47 YAMANASHI Takeshi
2003-02-21  5:55 ` Russ Cox
2003-02-21  7:09 YAMANASHI Takeshi
2003-02-21 15:06 ` Russ Cox

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=619e37293fcc0c4b393fce088c3ed209@plan9.bell-labs.com \
    --to=rsc@plan9.bell-labs.com \
    --cc=9fans@cse.psu.edu \
    /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).