When I run my proramm with large arrays, when it ends the momory remain allocated

Hi, how I can dealocate memory after I run my programm? Because when I run my ptogramm with big arrays when it ends the memory remain allocated. I try to use the gc() function but Hulia says “ERROR: LoadError: UndefVarError: gc not defined”.

  1. Unbind all global variables pointing to these arrays.
  2. If it doesn’t happen automatically, run GC.gc().

I tried to do array = 0 and GC.gc() but in the performance of my PC the memory is alredy allocated and only when I close Julia the memory is deallocated. Thanks for the answer.

Most likely some other objects are keeping memory from being garbage collected. You can check how much memory is taken by each top-level variable using varinfo().

1 Like

Thanks, varinfo() was so useful