Revert "Removed some old code that was supposed to help during low memory situations."

This reverts commit f94077371e7150947b587181a2431746a98e57e9.