From 1a21def23a81d2e97c99023d5361e1244dc10c10 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 13 Sep 2023 02:27:46 +0200 Subject: [PATCH] Enable logging for GC relevant information - call `GC.enable_logging(true)` at start of test suite - print information about what the GC thinks is the available memory We've been seeing crashes with Julia 1.10 and nightly, which may be GC related. Enabling this logging may reveal whether abnormal GC behavior is involved. --- test/runtests.jl | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/runtests.jl b/test/runtests.jl index 96d8434a10..54aeef1f25 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -2,6 +2,28 @@ using AbstractAlgebra using Test + +if VERSION >= v"1.8.0" + GC.enable_logging(true) + + # print gc settings + jlmax = @ccall jl_gc_get_max_memory()::UInt64 + totalmem = @ccall uv_get_total_memory()::UInt64 + constrmem = @ccall uv_get_constrained_memory()::UInt64 + println("Memory: max: ", Base.format_bytes(jlmax)) + println(" total: ", Base.format_bytes(totalmem)) + println(" constr: ", Base.format_bytes(constrmem)) + +#= FIXME/TODO: in the future we may wish to experiment with limiting the GC heap here + if VERSION >= v"1.10.0-" + # adjust heap size hint + memenv = parse(Int, get(ENV, "OSCARCI_MAX_MEM_GB", "5")) * 2^30 + println("Setting heap size hint to ", Base.format_bytes(memenv)) + @ccall jl_gc_set_max_memory(memenv::UInt64)::Cvoid + end +=# +end + include("Aqua.jl") include("rand.jl") include("AbstractAlgebra-test.jl")