Assuming you are using a spark shell .. installing spark.driver.memory in your application does not work because your driver process has already started with default memory.
You can start your spark shell using:
./bin/spark-shell
or you can set it to spark-defaults.conf:
spark.driver.memory 4g
If you run the application using spark-submit, you must specify the driver memory as an argument:
./bin/spark-submit --driver-memory 4g --class main.class yourApp.jar
source share