All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gregoire Banderet <gregoire.banderet@ge.com>
To: Linuxppc-embedded@ozlabs.org
Subject: Free memory, include "cached"?
Date: Mon, 06 Oct 2008 17:40:08 +0200	[thread overview]
Message-ID: <48EA3158.4040204@ge.com> (raw)

Hello,

I have to report the amount of FreeMem on my embedded system. The rootfs
is in RAM. I use /proc/meminfo.
I started by doing : freemem = MemFree + Buffers + Cached
But I realized (tell me if I'm wrong) that my rootfs filesystems is
counted in "Cached".
Part of the memory in "Cached" can be allocated, so I should add it as
Free Memory, but part of it is my rootfs (i.e. really used).
How should I compute freemem ?

Note that with linux 2.4 (initrd and not initramfs) I did use the ioctl 
BLKGETSIZE in order to subtract the amount of memory used by the rootfs. 
But now with initramfs it's dynamic.

Thanks,
Greg

                 reply	other threads:[~2008-10-06 15:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=48EA3158.4040204@ge.com \
    --to=gregoire.banderet@ge.com \
    --cc=Linuxppc-embedded@ozlabs.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.