Revert^2 "Handle OOM situation in java-heap more aggressively" am: 04a46f9ea4

Change-Id: Ibf1c5b4e5f074e65376e4f6ebe9d2799ac71fd87