spark is lazy evaluated. this means actual compute only starts at an action (like display).
without seeing the rest of the code it is impossible to see what the issue is.
According to the error message, there is an OOM error, most probably caused by some code somewhere.
Increasing memory is an option but I suggest reviewing why you use so much memory.