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?
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.
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With