Skip to content

Commit

Permalink
Make GC more safe
Browse files Browse the repository at this point in the history
  • Loading branch information
Uwe Fechner committed Mar 18, 2024
1 parent c21e4ae commit 9633a93
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/autopilot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ function simulate(integrator)
if mod(i, TIME_LAPSE_RATIO) == 0
KiteViewers.update_system(viewer, sys_state; scale = 0.04/1.1, kite_scale=6.6)
set_status(viewer, String(Symbol(ssc.state)))
# turn garbage collection back on if we are short of memory
if Sys.free_memory()/1e9 < 2.0
GC.enable(true)
end
wait_until(start_time_ns + 1e9*dt, always_sleep=true)
mtime = 0
if i > 10/dt
Expand Down

0 comments on commit 9633a93

Please sign in to comment.