Thanks everyone for your extremely useful tips. I seem to have it working now. The problem is that ZFS does memory allocations when asked to write things.
A makeshift solution is to do `echo 524288 > /proc/sys/vm/min_free_kbytes`. A more permanent fix will take more time to produce, but at least I have a handle on the situation now.
signature.asc
Description: OpenPGP digital signature