free the memory with A = nothing The memory will be released the next time the garbage collector runs; you can force this to happen with gc()