 <p>Every local object referenced inside a closure will be simply serialized and transfered with corresponding task. Beyond that Spark doesn't apply any special transformations - if you have local in-memory data structure it won't change when you use it inside a task.</p>