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