We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug if !memavail { ret.Available = ret.Free + ret.Buffers + ret.Cached } it is wrong way to calculate MemAvailable
To Reproduce
for example, postgres shared_buffers may be reported under "Cached"
Expected behavior bash version
LOW_WATERMARK=$(awk '$1 == "low" {LOW_WATERMARK += $2} END {print LOW_WATERMARK * 4096}' /proc/zoneinfo) MEMINFO=$(</proc/meminfo) MEMINFO_MEMFREE=$(echo "${MEMINFO}" | awk '$1 == "MemFree:" {print $2 * 1024}') MEMINFO_FILE=$(echo "${MEMINFO}" | awk '{MEMINFO[$1]=$2} END {print (MEMINFO["Active(file):"] + MEMINFO["Inactive(file):"]) * 1024}') MEMINFO_SRECLAIMABLE=$(echo "${MEMINFO}" | awk '$1 == "SReclaimable:" {print $2 * 1024}') MEMINFO_MEMAVAILABLE=$(( MEMINFO_MEMFREE - LOW_WATERMARK + MEMINFO_FILE - ((MEMINFO_FILE/2) < LOW_WATERMARK ? (MEMINFO_FILE/2) : LOW_WATERMARK) + MEMINFO_SRECLAIMABLE - ((MEMINFO_SRECLAIMABLE/2) < LOW_WATERMARK ? (MEMINFO_SRECLAIMABLE/2) : LOW_WATERMARK) )) if [[ "${MEMINFO_MEMAVAILABLE}" -le 0 ]] then MEMINFO_MEMAVAILABLE=0 fi
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered:
This will be fixed when #626 is merged.
Sorry, something went wrong.
PR was merged.
No branches or pull requests
Describe the bug
if !memavail {
ret.Available = ret.Free + ret.Buffers + ret.Cached
}
it is wrong way to calculate MemAvailable
To Reproduce
for example, postgres shared_buffers may be reported under "Cached"
Expected behavior
bash version
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: