[SPARK-2140] Updating heap memory calculation for YARN stable and alpha.