Bug 200628

Summary: Wired memory not released after deletion from ZFS, kernel kills processes
Product: Base System Reporter: pascal.guitierrez
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Only Me CC: samflanker
Priority: ---    
Version: 10.1-STABLE   
Hardware: amd64   
OS: Any   

Description pascal.guitierrez 2015-06-04 07:29:53 UTC
Seeing this behaviour on 10.1-RELEASE and 10.1-STABLE (May 26th) amd64 systems.

Systems are low-memory (2GB), but have also seen this behaviour on high (256GB) memory systems all without swap.

10.0-RELEASE seems to NOT be affected.

Run a system without swap and a ZFS filesystem (eg: 1TB to 2TB used).
Appears to be triggered when deleting (either through snapshots, or via regular files) a large of amount data (hundreds of GB) (even with few files).
Wired memory skyrockets and is never reclaimed until hitting vm.v_free_min, after which the kernel randomly kills processes to stay up.
Once this has been done, sometimes the wired memory is reclaimed, sometimes not.
Exactly the same config on 10.0-RELEASE is not affected.

Have tried setting:
vfs.zfs.arc_max=128M (and lower)
vfs.zfs.zio.use_uma=0 (no effect)
increasing v_free_min and v_free_target = system just kills processes faster
Comment 1 Vladimir Laskov 2015-08-29 10:39:42 UTC
my test case on 10.2-RELEASE amd64

1. create 1G file 
# dd if=/dev/urandom bs=1024 count=1024 of=blockout.bin
2. while : ; do cat blockout.bin ; done | pv -brt | dd bs=1024k count=16000 of=blockout2.bin
3. see Wired and ARC counts on 'top' output
4. remove blockout2.bin
5. see Wired and ARC counts on 'top' output

my solution: disable UMA for ZFS

try it