Gc() function no longer exists?

I start up julia from the command line using 1.4.1 (from Debian packages) and run:

dlakelan@pingpong:~$ julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.4.1
 _/ |\__'_|_|_|\__'_|  |  Debian ⛬  julia/1.4.1+dfsg-1
|__/                   |

julia> gc()
ERROR: UndefVarError: gc not defined
Stacktrace:
 [1] top-level scope at REPL[1]:1
 [2] eval(::Module, ::Any) at ./boot.jl:331
 [3] eval_user_input(::Any, ::REPL.REPLBackend) at /build/julia-pifKTc/julia-1.4.1+dfsg/usr/share/julia/stdlib/v1.4/REPL/src/REPL.jl:86
 [4] run_backend(::REPL.REPLBackend) at /home/dlakelan/.julia/packages/Revise/AMRie/src/Revise.jl:1023
 [5] top-level scope at none:0

that seems odd? Or did explicit gc() disappear at some point and I’m just seeing old code examples on the net?

Or is this specifically because my .julia/config/startup.jl loads Revise?

Perhaps you’re looking for GC.gc()

1 Like

probably! but that certainly wasn’t what was in the first 5 or 10 online examples I checked… did gc move to GC recently (ie. the last 2 years)?

This is a great example of why I suggested that help? should include deprecated items.

2 Likes