Github user shivaram commented on a diff in the pull request:
https://github.com/apache/spark/pull/14775#discussion_r76523010
--- Diff: R/pkg/R/jobj.R ---
@@ -82,7 +82,20 @@ getClassName.jobj <- function(x) {
callJMethod(cls, "getName")
}
-cleanup.jobj <- function(jobj) {
+#' Garbage collect Java Objects
+#'
+#' Garbage collect an object allocated on Spark driver JVM heap.
+#'
+#' cleanup.jobj is a low level method that lets developers manually
garbage collect objects
+#' allocated using newJObject. This is only to be used for advanced use
cases as objects allocated
+#' on the JVM heap are automatically garbage collected when the
corresponding R reference goes out
+#' of scope.
+#'
+#' @param x the Java object that should be garbage collected.
+#' @note cleanup.jobj since 2.0.1
+#' @export
+cleanup.jobj <- function(x) {
+ jobj <- x
if (isValidJobj(jobj)) {
--- End diff --
I guess since this is back to an internal method we dont need to worry
about it. But I guess I can add the check if we still want it ?
---
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]