bash – ‘top’中的Faults列是什么?

我正在尝试下载
Xcode(到El Capitan版本),它似乎被卡住了.当我运行’top’时,我看到一个名为’storedownloadd’的进程,而’STATE’列在休眠,卡住和运行之间交替. ‘FAULTS’的数字快速增加,后面带加号. ‘FAULTS’栏目现已超过400,000并且正在增加.除了“顶部”之外,我看不到下载活动的迹象.这表明有什么不妥吗?这是一个屏幕截图:

Processes: 203 total, 2 running, 10 stuck, 191 sleeping, 795 threads                                                                                                                                                                                                11:48:14
Load Avg: 4.72, 3.24, 1.69  CPU usage: 56.54% user, 6.41% sys, 37.3% idle    SharedLibs: 139M resident, 19M data, 20M linkedit. MemRegions: 18620 total, 880M resident, 92M private, 255M shared. PhysMem: 7812M used (922M wired), 376M unused.
VM: 564G vsize, 528M framework vsize, 0(0) swapins, 512(0) swapouts. Networks: packets: 122536/172M in, 27316/2246K out. Disks: 78844/6532M read, 240500/6746M written.

PID  COMMAND          %CPU  TIME     #TH   #WQ  #PORT MEM    PURG   CMPRS  PGRP PPID STATE    BOOSTS          %CPU_ME   %CPU_OTHRS UID  FAULTS  COW    MSGSENT  MSGRECV  SYSBSD    SYSMACH
354  storedownloadd   0.3   00:47.58 16    5    200   255M   0B     0B     354  1    sleeping *3[1]           155.53838 0.00000    501  412506+ 54329  359852+  6620+    2400843+  1186426+
57   UserEventAgent   0.0   00:00.35 22    17   378   4524K+ 0B     0B     57   1    sleeping *0[1]           0.23093   0.00000    0    7359+   235    15403+   7655+    24224+    17770
384  Terminal         3.3   00:12.02 10    4    213   34M+   12K    0B     384  1    sleeping *0[42]          0.11292   0.04335    501  73189+  482    31076+   9091+    1138809+  72076+ 

最佳答案 当top报告回FAULTS时,它指的是“页面错误”,更具体地说:

The number of major page faults that have occurred for a task. A page
fault occurs when a process attempts to read from or write to a
virtual page that is not currently present in its address space. A
major page fault is when disk access is involved in making that page
available.

如果应用程序尝试访问当前不在物理RAM中的内存页上的地址,则会发生页面错误.当发生这种情况时,虚拟内存系统会调用一个特殊的页面错误处理程序来立即响应故障.页面错误处理程序阻止代码执行,找到物理内存的空闲页面,加载包含磁盘所需数据的页面,更新页面表,最后将控制权返回给程序 – 然后可以正常访问内存地址.此过程称为分页.

根据尝试执行的代码和系统上当前的内存可用性,可能会出现轻微的页面错误,但是,还有不同的级别需要注意(次要,主要,无效),这些都在下面详细介绍.以下链接.

Apple : About The Virtual Memory System

Wikipedia : Page Fault

Stackoverflow.com : page-fault

点赞