Stop ZFS from eating your RAM until the OOM killer wakes up

Filesystem & Storage (ZFS/Btrfs/LVM)

Stop ZFS from eating your RAM until the OOM killer wakes up

Technical Briefing | 8/11/2026

You probably installed ZFS for the features like snapshots or data integrity. Then you noticed your server’s available memory plummeting. It is not a leak, it is the Adaptive Replacement Cache, but when your application needs that RAM and the kernel decides ZFS is a convenient target for the OOM killer, you have a problem. I have seen more production databases tank because the ARC didn’t yield memory fast enough than I care to admit.

Why the defaults are killing you

By default, ZFS tries to grab half of your system RAM. On a dedicated storage head, that is fine. On a box running other services, it is a liability. You need to pin the ceiling before the kernel has to get aggressive.

echo 8589934592 > /sys/module/zfs/parameters/zfs_arc_max

  • Use zfs_arc_max to cap the upper limit in bytes
  • Keep the floor reasonable with zfs_arc_min to prevent total cache eviction
  • Persist these changes in /etc/modprobe.d/zfs.conf or you will be back to square one after a reboot

Watching the carnage in real-time

Don’t just guess what the cache is doing. If you are trying to debug a weird slowdown, check the arcstat output. If hits are low and the arc_max is hit, your apps are starving for no reason. Adjust accordingly, but keep the min/max gap wide enough that you aren’t constantly resizing the pool.

The next time you see that system load jump for no apparent reason, look at your ARC stats before you start chasing down misbehaving processes. Sometimes the filesystem is just doing its job too well.

Linux Admin Automation  |  © www.ngelinux.com  |  8/11/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted