什么是活动内存和非活动内存 [英] What is active memory and inactive memory

查看:562
本文介绍了什么是活动内存和非活动内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是活动内存和不活动内存?我正在Linux机器上执行命令vmstat -a,并且得到以下输出:

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. are pages which have not been accessed "recently"

要查看内存,请使用/proc/meminfo而不是vmstat -a

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

修改 按照@kubanczyk的评论: 您可以从此问题

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

这篇关于什么是活动内存和非活动内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆