Revert "Revert "oom: remove unnecessary code and cleanup""

This reverts commit a02d136c9c1c30fa5d58a51e4fb1d353d6cc8526.