Revert "Revert^2 "Handle OOM situation in java-heap more aggressively"" am: 685c84775f

Change-Id: Ifd161e8230e542c34cd640764833d669f9d0d3d9