Github user sun-rui commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14775#discussion_r76007335
  
    --- Diff: R/pkg/NAMESPACE ---
    @@ -363,4 +363,9 @@ S3method(structField, jobj)
     S3method(structType, jobj)
     S3method(structType, structField)
     
    +export("newJObject")
    +export("callJMethod")
    +export("callJStatic")
    +export("cleanup.jobj")
    --- End diff --
    
    I am a little confused about the discussion at 
https://issues.apache.org/jira/browse/SPARK-16611:
    ````
        d) cleanup.jobj:
        SystemML uses the MLContext and matrixCharacteristic class that is 
instantiated in JVM and whose object      ref is kept alive in the sparkR and 
later when systemML has done it’s computation. we cleanup the objects. The 
way we achieve it using the References classes in R and use it’s finalize 
method to register the cleanup.jobj once we have created the jobj via 
newJObject(“sysml.class”)
    ````
    It seems that systemML still uses automatic GC to cleanup jobjs as it is 
said that "use it’s finalize method to register the cleanup.jobj ". But a 
jobj already has cleanup.jobj registered as its finalizer. 
    If my understanding is correct, I don't see strong reason for exposing 
cleanup.jobj. If active cleanup is demanded, a call to "gc" can be made?


---
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