Skip to content

Commit

Permalink
Merge pull request #615 from kyeongy/main
Browse files Browse the repository at this point in the history
proc: fix MemAvailable in /proc/meminfo to exclude tmpfs files
  • Loading branch information
stgraber committed Oct 4, 2023
2 parents 87a2fe9 + 5340b27 commit 35ab918
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/proc_fuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1351,7 +1351,7 @@ static int proc_meminfo_read(char *buf, size_t size, off_t offset,
snprintf(lbuf, 100, "MemFree: %8" PRIu64 " kB\n", memlimit - memusage);
printme = lbuf;
} else if (startswith(line, "MemAvailable:")) {
snprintf(lbuf, 100, "MemAvailable: %8" PRIu64 " kB\n", memlimit - memusage + mstat.total_cache / 1024);
snprintf(lbuf, 100, "MemAvailable: %8" PRIu64 " kB\n", memlimit - memusage + (mstat.total_active_file + mstat.total_inactive_file) / 1024);
printme = lbuf;
} else if (startswith(line, "SwapTotal:")) {
if (wants_swap) {
Expand Down

0 comments on commit 35ab918

Please sign in to comment.