如何移除 MACOSX 中 Inactivated Memory

Intel 的 MAC 用戶有時候會遇到很鬱悶的東西,就是不停的出現程序崩潰。

有的的確是用戶可用內存出現問題,比如現在的這個 Inactivated Memory。


蘋果是這樣解釋 Inactivated Memory 的:

This information in memory is not actively being used, but was recently used.

For example, if you've been using Mail and then quit it, the RAM that Mail was using is marked as Inactive memory. This Inactive memory is available for use by another application, just like Free memory.  However, if you open Mail before its Inactive memory is used by a different application, Mail will open quicker because its Inactive memory is converted to Active memory, instead of loading Mail from the slower hard disk.

Free Memory 是這樣解釋的:

This is RAM that's not being used.


但有的時候會遇到 Inactivated Memory 佔用了過大的內存空間,Free Memory 就變得超級少。。

這時候,打開新的app,就很有可能會崩潰,而且莫名其妙的崩潰。

網上有很多 app 可以清除這個內存塊,不過不要忘記,MAC 是 UNIX。

在UNIX裏面有個命令叫做 purge

如果要清除這塊內存,直接打開命令行 -> purge 回車,等待即可。

然後就會發現, Inactivated 內存就被完美的清理掉了。


man 一下 purge,我們看看這個命令的用法:

purge(8)                  BSD System Manager's Manual                 purge(8)


NAME
     purge -- force disk cache to be purged (flushed and emptied)


SYNOPSIS
     purge


DESCRIPTION
     Purge can be used to approximate initial boot conditions with a cold disk
     buffer cache for performance analysis. It does not affect anonymous memory
     that has been allocated through malloc, vm_allocate, etc.


SEE ALSO
     sync(8), malloc(3)


                              September 20, 2005


看來就是用來清理 buffer cache 的恩。

最後,

Take your own risk!

After you purge your inactivated memory, all your apps will be slow down immediately. 



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值