Memory allocation is expansive. It is important to find the unecessary memory allocation in the code. You may profile the memory usage of your code with the following steps.
julia --track-allocation=user script.jl
find . -name "*.mem" -type f -delete
— Jan 15, 2022
Made with ❤ and at Earth.