We've also encountered "ngx_slab_alloc() failed: no memory in.." errors when the amount of memory was definitely sufficient, turned out to be caused by memory fragmentation. Restarting or performing an on the fly upgrade of nginx mitigated the problem for a while. Basically it can start happening over long nginx master uptimes.