Page MenuHomePhabricator

final class PhutilSystem
Arcanist Technical Documentation ()

Interact with the operating system.

Tasks

Interacting with System Memory

  • public static function getSystemMemoryInformation() — Get information about total and free memory on the system.
  • public static function parseMemInfo($data) — Parse the output of `/proc/meminfo`.
  • public static function parseVMStat($data) — Parse the output of `vm_stat`.

Methods

public static function getSystemMemoryInformation()

Get information about total and free memory on the system.

Because "free memory" is a murky concept, the interpretation of the values returned from this method will vary from system to system and the numbers themselves may be only roughly accurate.

Return
map<string, wild>Dictionary of memory information.

public static function parseMemInfo($data)

Parse the output of /proc/meminfo.

See getSystemMemoryInformation(). This method is used to get memory information on Linux.

Parameters
string$dataRaw `/proc/meminfo`.
Return
map<string, wild>Parsed memory information.

public static function parseVMStat($data)

Parse the output of vm_stat.

See getSystemMemoryInformation(). This method is used to get memory information on Mac OS X.

Parameters
string$dataRaw `vm_stat` output.
Return
map<string, wild>Parsed memory information.