Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is active memory and inactive memory [closed]

Tags:

linux

What is active memory and inactive memory? I am executing the command vmstat -a on a Linux machine and I am getting the following output:

vmstat -a
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
 r  b   swpd   free  inact active   si   so    bi    bo   in   cs us sy id wa st
 1  0 249900 4801880 2649428 8246152    0    0    42    31    0    0  4  0 95  0  0

But I am not getting what exactly active and inactive memory is... Could you please elaborate?

like image 617
user2714918 Avatar asked Aug 30 '13 09:08

user2714918


People also ask

What is active and inactive memory?

Active memory is memory that is being used by a particular process. Inactive memory is memory that was allocated to a process that is no longer running.

What does inactive memory mean?

Definition of Inactive memory: The total amount of buffer or page cache memory that are free and available. This is memory that has not been recently utilized by any application for some time and can be reclaimed for other purposes by the paging algorithm.

What is inactive memory on Mac?

Inactive is memory which has been used before but is no longer used. Active memory is what your applications are currently using. Wired memory is system memory that Mac OS is using.

What is Active memory in vmstat?

The vmstat command summarizes the total active virtual memory used by all of the processes in the system, as well as the number of real-memory page frames on the free list. Active virtual memory is defined as the number of virtual-memory working segment pages that have actually been touched.


1 Answers

There are two states of "used" memory, "inactive" and "active".

Active memory is memory that is being used by a particular process.
Inactive memory is memory that was allocated to a process that is no longer running. are pages which have not been accessed "recently"

to see the memory use /proc/meminfo rather than vmstat -a

cat /proc/meminfo  

you need not to clear this Inactive memory When system reboots this memory automatically became vanish, still If you have a large amount of inactive memory ,you can use following command.

free && sync && echo 3 > /proc/sys/vm/drop_caches && echo "" && free

Edit As per @kubanczyk comment: you can find more information from this question

like image 60
Gangadhar Avatar answered Sep 30 '22 04:09

Gangadhar