What do you mean by "So adding `set_max_mem' causes test to behaveidentically for me."? Does it mean that it takes a long time before reporting out of memory, or just that it works as well as if `set_max_mem' was not present? I'm trying to build a test that reproduces the long delay but so far I cannot reproduce it.