What is the Faults column in 'top'?
Asked Answered
R

1

7

I'm trying to download Xcode (onto version El Capitan) and it seems to be stuck. When I run 'top', I see a process called 'storedownloadd' and the "STATE" column is alternating between sleeping, stuck,and running. The 'FAULTS' has a quickly increasing number with a plus sign after it. The 'FAULTS' column is now over 400,000 and increasing. other than 'top', I see no sign of activity of the download. Does this indicate that something is amiss? Here's a screen shot:

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+ 
Rawlins answered 10/5, 2016 at 16:52 Comment(0)
C
8

When top reports back FAULTS it's referring to "page faults", which are more specifically:

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.

If an application tries to access an address on a memory page that is not currently in physical RAM, a page fault occurs. When that happens, the virtual memory system invokes a special page-fault handler to respond to the fault immediately. The page-fault handler stops the code from executing, locates a free page of physical memory, loads the page containing the data needed from disk, updates the page table, and finally returns control to the program — which can then access the memory address normally. This process is known as paging.

Minor page faults can be common depending on the code that is attempting to execute and the current memory availability on the system, however, there are also different levels to be aware of (minor, major, invalid), which are described in more detail at the links below.

Apple : About The Virtual Memory System

Wikipedia : Page Fault

Stackoverflow.com : page-fault

Cellular answered 10/5, 2016 at 17:56 Comment(1)
@I'L'I So "FAULTS" reported by MacOS top command and vm_stat command are referring to major page fault, which requires actually disk access?Sacksen

© 2022 - 2024 — McMap. All rights reserved.