Commit c8464386 authored by Romulo Pereira Goncalves's avatar Romulo Pereira Goncalves
Browse files

Garbage collector when finishing a job. Clean on the way out.

parent bb5b7d9e
......@@ -113,7 +113,9 @@ sample_nb <- function(raster,
pbtn2 = pbtn2,
ras_vx = ras.vx,
max_samples_per_class = max_samples_per_class,
mc.cores = cores
mc.cores = cores,
mc.preschedule = TRUE,
mc.cleanup = TRUE
)
for (k in 1:nb_mean) {
points_list[[k]] <- res[["k" = k]][["points"]]
......
......@@ -294,6 +294,7 @@ model_opt_r <- function(k,
pbt <- rbind(pbtn1, pbtn2)
}
remove(pbt)
gc()
return(list(
"k" = k,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment