In my R code, I use the MixedModels Julia package.
I integrate Julia in R using the JuliaCall package.
I work with very large datasets (~1 GB, ~4x10^6 observations) and at the modeling step (mixed models) a lot of RAM is allocated (~80 GB), most of it does not return to the system after the end of calculations.
How can I close the connections to Julia from under R (or maybe close Julia) after obtaining the modeling results in the R environment? At the same time, the R session should not be interrupted, since after calculating the mixed models, other functions should be executed in pipeline.
This action can help release certain amount of memory to the system (I ran code on pure Julia and after Julia exit about 70 GB was returned to OS. When I run code on R, RAM occupied by Julia is not returned to OS after pipeline calculations are completed)
(Platform: x86_64-pc-linux-gnu).