Dynamic Memory Allocation In Spark