Skip to content

Commit

Permalink
44 force garbage collection after each task loop (#45)
Browse files Browse the repository at this point in the history
* Test gc usage

* Force garbage collection

* Update R/check_design.R

Co-authored-by: dgkf-roche <91694157+dgkf-roche@users.noreply.github.com>

---------

Co-authored-by: dgkf-roche <91694157+dgkf-roche@users.noreply.github.com>
  • Loading branch information
maksymiuks and dgkf-roche authored Sep 27, 2024
1 parent d2af9ad commit d409357
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: checked
Title: Systematically Run R CMD Checks
Version: 0.2.3.9004
Version: 0.2.3.9005
Authors@R:
c(
person(
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@

* Prettify output by stripping excessive new lines.

* Force garbage collection before scheduling task, to make sure any already
finished processes are removed from the memory.

# checked 0.2.3

* Use custom `checked` `finisher`'s instead of the `processx` `finalizer`'s
Expand Down
3 changes: 3 additions & 0 deletions R/check_design.R
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ check_design <- R6::R6Class( # nolint cyclocomp_linter
if (self$is_done()) {
return(-1L)
}

# force garbage collection to free memory from terminated processes
gc(verbose = FALSE, reset = FALSE, full = TRUE)

# if all available processes are in use, terminate early
n_active <- length(private$active)
Expand Down

0 comments on commit d409357

Please sign in to comment.