I was watching this presentation that is about spark memory management.
He talks about how they achieve fairness between different tasks in one executor (12:00). And he presents the idea of dynamic assignment between tasks and he declares that Spark spill other task's pages to disk if more tasks begin to execute.
I read before tasks in Spark are essentially threads and in Java we don't have this capability to manage the memory of threads and establish memory fairness between them. I wonder how Spark achievs this?