Skip to content

Commit

Permalink
Only run GC 3 times instead of 4 to scrub (#350)
Browse files Browse the repository at this point in the history
* Only run GC 3 times instead of 4 to scrub

Per slack, 'Diogo changed it so it only needs 3 to promote everything to old generation now'.

* Still run gc 4 times on older Julia versions

* Format
  • Loading branch information
Zentrik authored Jan 4, 2024
1 parent 42155f7 commit 3742326
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/execution.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# Trigger several successive GC sweeps. This is more comprehensive than running just a
# single sweep, since freeable objects may need more than one sweep to be appropriately
# marked and freed.
gcscrub() = (GC.gc(); GC.gc(); GC.gc(); GC.gc())
function gcscrub()
GC.gc()
GC.gc()
GC.gc()
@static if VERSION < v"1.10"
GC.gc()
end
end

#############
# Benchmark #
Expand Down

0 comments on commit 3742326

Please sign in to comment.