pos*_*def 5 memory mac osx-snow-leopard macbook-pro
我在配备 4GB RAM 的 Macbook pro(型号 8,1)上运行 SL。就目前而言,我只有iTerm2、QuickSilver 和 Activity Monitor 正在运行(以及后台的几个守护程序,例如 Dropbox 和 Citations,使用的内存都不超过 20-30 MB)。当我检查内存使用情况时,它显示 900+ MB 为Wired,而几乎是一个演出Active。
检查我的进程列表,顶部进程似乎正在消耗 60-70 MB。如果我按层次列出所有进程,我会看到kernel_task哪些进程使用了大约 350 MB。不用说,这是非常奇特的。
作为一个偏执的书呆子,我开始怀疑是否有一些隐藏的恶意软件在幕后吞噬资源。有没有办法检查?否则这种无法解释的高内存使用率的原因可能是什么?
作为您的用户,您只能在 OSX 中看到您的 launchd 引导程序。你住在 Aqua 域。因此,要查看因您而运行的所有内容:
launchctl list
Run Code Online (Sandbox Code Playgroud)
将向您展示已加载的内容。然而,这还不是全部。launchctl有很多选择,例如:
bslist [PID | ..] [-j]
This prints out Mach bootstrap services and their respective
states. While the namespace appears flat, it is in fact hierar-
chical, thus allowing for certain services to be only available
to a subset of processes. The three states a service can be in
are active ("A"), inactive ("I") and on-demand ("D").
If [PID] is specified, print the Mach bootstrap services avail-
able to that PID. If [..] is specified, print the Mach bootstrap
services available in the parent of the current bootstrap. Note
that in Mac OS X v10.6, the per-user Mach bootstrap namespace is
flat, so you will only see a different set of services in a per-
user bootstrap if you are in an explicitly-created bootstrap
subset.
If [-j] is specified, each service name will be followed by the
name of the job which registered it.
Run Code Online (Sandbox Code Playgroud)
因此,作为您的用户:
launchctl bslist -j
Run Code Online (Sandbox Code Playgroud)
将为您提供当前加载到 launchd 中的所有内容,任何实际运行的内容旁边都会有一个“A”。
...
A com.apple.cookied (com.apple.cookied)
D com.apple.coreservices.quarantine-resolver (com.apple.coreservices.uiagent)
Run Code Online (Sandbox Code Playgroud)
这里 cookied (wtf?) 正在运行。下面,隔离解析器已加载,但并未实际运行。
现在,也许,您可能倾向于尝试以下操作:
sudo launchctl list
Run Code Online (Sandbox Code Playgroud)
认为作为根,你会看到一切。不。Root 住在 System 域中,无法真正清楚地看到您。您将在系统或守护进程域中运行。
阅读手册页,您会发现:
sudo launchctl bstree -j # This should show you everything.
ps au
Run Code Online (Sandbox Code Playgroud)
作为为您提供在系统上运行的整个 Mach 树的命令。
活动监视器向您展示了一些东西,但我并不喜欢依赖它。
参考:
http://developer.apple.com/library/mac/#technotes/tn2083/_index.html
| 归档时间: |
|
| 查看次数: |
3009 次 |
| 最近记录: |