fastfetch icon indicating copy to clipboard operation
fastfetch copied to clipboard

Memory (FreeBSD): fixing disk cache fetching

Open crocidb opened this issue 5 months ago • 1 comments

Summary

Memory fetching for FreeBSD was using vm.stats.vm.v_cache_count as cache, but FreeBSD's kernel doesn't have cache pages since version 12. The value is still there for compatibility, but it returns always 0.

Changes

  • using filesystem buffer cache and ARC cache: vfs.bufspace tracks the bytes used to buffer the filesystem addressing for other filesystems than ZFS, and ARC tracks buffers AND cache for ZFS, which bypasses bufspace entirely. I also decrease the minimum ARC cache, since that's arguably non retrievable memory. The results now are more aligned with how other monitoring tools track memory. In fact, I submitted PRs for btop and htop to fix similar issues.

Checklist

  • [x] I have tested my changes locally

crocidb avatar Jun 25 '26 17:06 crocidb

Up to standards :white_check_mark:

🟢 Issues 0 issues

Results: 0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer TIP This summary will be updated as you push new changes.

codacy-production[bot] avatar Jun 25 '26 17:06 codacy-production[bot]