Skip to content

Commit

Permalink
Add code by Benjamin to print GC settings, increase heap size limit
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Sep 13, 2023
1 parent ea0a69d commit e07d28b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,24 @@ 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))

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")
Expand Down

0 comments on commit e07d28b

Please sign in to comment.