GitHub user davies opened a pull request:

    https://github.com/apache/spark/pull/4923

    [SPARK-6194] [PySpark] fix memory leak in collect()

    Because circular reference between JavaObject and JavaMember, an Java 
object can not be released until Python GC kick in, then it will cause memory 
leak in collect(), which may consume lots of memory in JVM.
    
    This PR change the collect() to get the iterator from JVM directly (avoid a 
method call `iterator()`), it also fix a bug in py4j, which will create a 
`Java` member for all the JavaObject parameters.
    
    cc @JoshRosen 

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/davies/spark fix_collect

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/4923.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #4923
    
----
commit 9517c8f50231ed7bfdc7e4412bd0d7e5715cb600
Author: Davies Liu <[email protected]>
Date:   2015-03-06T02:11:43Z

    fix memory leak in collect()

----


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to