Learn R Programming

J4R (version 1.0.7)

callJavaGC: Synchronize the Java environment with the R environment

Description

This function synchronizes the Java environment with the R environment. Objects that are removed from the R environment are not automatically removed from the Java environment. This function scans the R environment for the java.object instance and commands the gateway server to get rid of the Java instances that are not longer referred to in the R environment.

Usage

callJavaGC(...)

Arguments

...

a list of environment instances if the method is called within a function

Value

An integer which is the number of Java objects still registered in the Java environment

Details

To avoid a memory leak, the function should be called on a regular basis.

See Also

J4R webpage