Skip to content

[mem][linux]: Remove deprecated opt-out for MemAvailable-based Used#2012

Open
shirou wants to merge 1 commit intomasterfrom
fix/revert_opt-outed_mem_used_calc
Open

[mem][linux]: Remove deprecated opt-out for MemAvailable-based Used#2012
shirou wants to merge 1 commit intomasterfrom
fix/revert_opt-outed_mem_used_calc

Conversation

@shirou
Copy link
Owner

@shirou shirou commented Mar 4, 2026

Summary

  • Remove the deprecated WillBeDeletedOptOutMemAvailableCalc constant and opt-out code path for the old mem.Used calculation
  • This was introduced in [mem][linux]: Used calculated from Total and Available #1882 as a temporary migration aid, scheduled for removal in March 2026
  • mem.Used is now always calculated as Total - Available, consistent with modern free/top (procps-ng v4.0.1+)

Breaking Change

The WillBeDeletedOptOutMemAvailableCalc constant is removed. Code using this context key to opt out of the new calculation will fail to compile. Remove the opt-out usage — the new formula is the correct one.

See #1873 for background.

…alculation

Remove WillBeDeletedOptOutMemAvailableCalc constant and the associated
opt-out code path that was scheduled for removal in March 2026.

The old formula (Total - Free - Buffers - Cached) is no longer available.
mem.Used is now always calculated as Total - Available, consistent with
modern procps-ng tools (free, top) since v4.0.1.

Closes #1873
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant