LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Finding total free memory available for use by applications. (https://www.linuxquestions.org/questions/linux-general-1/finding-total-free-memory-available-for-use-by-applications-748104/)

Shashank Rachamalla 08-17-2009 07:37 AM

Finding total free memory available for use by applications.
 
Hi

I want to find the total free memory that is available for use by applications at a given instance of time. After little exploration I found that kernel allocates some amount of physical memory to cache and buffers while holding the right to reclaim a part of it when applications fall short of memory. The following information can be fetched from /proc/meminfo.

MemFree - The amount of physical RAM, in kilobytes, left unused by the system

Cached — The amount of physical RAM, in kilobytes, used as cache memory.

Buffers — The amount of physical RAM, in kilobytes, used for file buffers.

Active - The total amount of buffer or page cache memory, in kilobytes, that is in active use. This is memory that has been recently used and is usually not reclaimed for other purposes.

Inactive - The total amount of buffer or page cache memory, in kilobytes, that are free and available. This is memory that has not been recently used and can be reclaimed for other purposes.

(see - http://www.redhat.com/docs/manuals/e...c-meminfo.html for understanding attributes in /proc/meminfo )

Total Memory available for use by applications = MemFree + Inactive should hold good in this case. What do you suggest?

Also should (Cached + Buffers) = (Active + Inactive) hold good?

neonsignal 08-17-2009 09:25 AM

Have you also considered swap memory on the disk (and the cached swap in physical ram)?


All times are GMT -5. The time now is 12:05 AM.