kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: Neel chakraborty <neelroboinfo365@gmail.com>
To: kernelnewbies@kernelnewbies.org
Subject: Free RAM in Linux .
Date: Tue, 17 Dec 2019 10:39:08 +0530	[thread overview]
Message-ID: <CAENbuEoY6T8uh2t7f2DgF_ws9H93k03EKYcLZnWbOPRKEeJgpg@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1064 bytes --]

I was studying the Linux Kernel Source , and came across this doubt .

Does Linux use all of the physical memory (RAM) I have ? In both the
outputs of /proc/meminfo and free -h , shows that 1.4 gigs is used and 1.6
gigs is cached , and the rest is "free" out of 32 Gigs . The available ram
is the cached ram + reclaimable ram + free ram , right ?

I went through the source code of /fs/proc/meminfo.c and it's polling ram
usage from the sysinfo struct , so I browsed through
/linux/include/uapi/Linux/sysinfo.h , over there freeram is available
memory size .

But again in meminfo.c , we are seeing MemFree as i.freeram ( here i is
assigned to the structure of type sysinfo ) .

so is free ram = available memory ? But then , I have free ram of 27 Gi ,
and available memory of 28 Gi , why is that ?

And also , does the linux kernel use the amount of ram which is not used by
applications as paging cache ? Say I have 4 gigs of ram , and Firefox is
using 1 gig of it , the rest of RAM is used for disk/page caching or is it
just unused and left there ?

Thank you

[-- Attachment #1.2: Type: text/html, Size: 1432 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

             reply	other threads:[~2019-12-17  5:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-17  5:09 Neel chakraborty [this message]
2019-12-17  6:29 ` Free RAM in Linux Valdis Klētnieks

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=CAENbuEoY6T8uh2t7f2DgF_ws9H93k03EKYcLZnWbOPRKEeJgpg@mail.gmail.com \
    --to=neelroboinfo365@gmail.com \
    --cc=kernelnewbies@kernelnewbies.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).