Fix Deadlock when system is low on memory