Github user carsonwang commented on the pull request:

    https://github.com/apache/spark/pull/9991#issuecomment-160055041
  
    The original purpose of this PR is to fix the `SQLListenerMemoryLeakSuite` 
test failure. This can be resolved by clearing `SQLContext.sqlListener` before 
the test.
    
    To prevent memory leak similar to SPARK-11700, I added a `SparkContext` 
stop hook to clear the `sqlListener` reference. I didn't make 
`SQLContext.clearSqlListener` a public API because it seems a little confusing 
for users to call it. And the `sqlListener` is added to SparkContext, it will 
not be GCed at once even if a user calls `SQLContext.clearSqlListener`. Now we 
clear the reference when the `SparkContext` is being stopped to allow the 
`sqlListener` to be GCed later.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to