Homec4science

Add a utility class for getting system memory information

Authored by epriestley <git@epriestley.com> on Feb 24 2015, 16:52.

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

Committed
epriestley <git@epriestley.com>Feb 24 2015, 16:52
Pushed
aubortMar 17 2017, 12:03
Parents
rPHUe2cdf9f89c88: Make parsing of daemon PIDs more robust
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHU77f0eda5b427: Add a utility class for getting system memory information (authored by epriestley <git@epriestley.com>).Feb 24 2015, 16:52