HomePhabricator

Add a utility class for getting system memory information

Description

Add a utility class for getting system memory information

Summary:
Ref T7352. I want to implement the hard memory barrier described in T7352#98018 to prevent all pools from scaling upward and throwing a machine into a death spiral.

To do this, I need to be able to get at least a rough picture of free system memory. This is a little murky, but we only need to have an approximate picture of it so we can cut daemons off sometime before everything goes to swap.

Add a class that queries the system and gives us some usable information back in a standard format.

Test Plan:

  • Added and executed unit tests for vm_stat (os x) and /proc/meminfo (linux).
  • Ran method locally, got reasonable output.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7352

Differential Revision: https://secure.phabricator.com/D11863

Details

Provenance
epriestleyAuthored on
epriestleyPushed on Feb 24 2015, 3:52 PM
Reviewer
btrahan
Differential Revision
D11863: Add a utility class for getting system memory information
Parents
rPHUe2cdf9f89c88: Make parsing of daemon PIDs more robust
Branches
Unknown
Tags
Unknown
Tasks
T7352: Improve daemon scalability in the cluster