#52299: feat: expose MemAvailable as process.getSystemMemoryInfo().available
Merged
Description of Change
On Linux the returned free is /proc/meminfo MemFree - free pages only, excluding page cache and other reclaimable memory. Any long-uptime machine reads a few percent "free" with no real memory pressure, so free / total is useless as a pressure signal and apps end up parsing /proc/meminfo themselves.
Chromium already parses MemAvailable into base::SystemMemoryInfo::available; we just never exposed it. This adds it to the returned object as available, the kernel's estimate of memory available for allocation without swapping.
Checklist
- I have built and tested this change
- I have filled out the PR description
- I have reviewed and verified the changes
-
npm testpasses - tests are changed or added
- relevant API documentation, tutorials, and examples are updated and follow the documentation style guide
- PR release notes describe the change in a way relevant to app developers, and are capitalized, punctuated, and past tense.
Release Notes
Notes: Added available to process.getSystemMemoryInfo() on Linux, exposing proc/meminfo MemAvailable.
Backports
Semver Impact
Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron