In Spark 1.0, with the newly added garbage collection mechanism, when the query plan itself goes out of scope, the broadcast variable should also be cleaned automatically.

Another way we can do this is to have some query context object we pass around the entire physical query plan which tracks the stuff we need to clean up.