This looks like incorrect change if I understood it right.

We are trying to see if the cluster has sufficient memory to satisfy the memory requirements of the spark job.