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.
這時候,打開新的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.