All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Patrick R. McManus" <mcmanus@ducksong.com>
To: linux-kernel@vger.kernel.org
Subject: Memory Measurements and Lots of Files and Inodes
Date: Wed, 11 Dec 2002 18:52:58 -0500	[thread overview]
Message-ID: <20021211235258.GA10857@ducksong.com> (raw)

Hello All,

I've got a box with 750MB of RAM.. for the sake of this test, I've
turned off swap. I also have a little program that creates and deletes
lots of little files on a RAMDISK with ext2 on it. The ramdisk is only
4MB max and the files are about 3K and there are never more than four
of them at a time - but the program is constantly creating and
deleting hundreds of thousands of them. I have no reason to think this
issue is unique to the ramdisk - it just makes files faster.

Just sitting back and watching vmstat while this runs my 'free' memory
drops from ~600MB to about ~16MB.. the buffers and cache remain roughly
constant.. at 16MB some sort of garbage collection kicks in - there is
a notable system pause and ~70MB moves from the used to the 'free'
column... this process repeats more or less in a steady state.

If, while this is going on, I run another little app that does
{x= malloc(300MB), memset (x,0,300MB), free (x)}.. suddenly I can move
300MB from the used to the 'free' state...

I assume there is some VFS structure that is growing (perhaps related
to the tremendous # of inodes I'm going through) and is only cleansed
when the number of free pages gets too low.. I'd be interested in any
details someone could provide.

My real question is about the commonly (?) used metric of
free+buffers+cached representing the size of an allocation that could
succeed.. my 300MB allocation above proves that doesn't apply
here.. although, if I turn on strict accounting, that 300MB does fail
even though there is only perhaps 150MB of userspace allocations
outstanding on the box.

Can anybody provide a better metric for "ram free for userspace
allocations"?

Thanks,
-Patrick

             reply	other threads:[~2002-12-11 23:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-11 23:52 Patrick R. McManus [this message]
2002-12-12  0:09 ` Memory Measurements and Lots of Files and Inodes Andrew Morton
2002-12-12  0:21   ` Patrick R. McManus
2002-12-12  0:27     ` Andrew Morton
2002-12-13  8:39 ` David Schwartz

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=20021211235258.GA10857@ducksong.com \
    --to=mcmanus@ducksong.com \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.