After each iteration the smi doesn’t shows the freed memory. it is just used in next iteration. however, if the next iteration uses more memory than previous, it just adds up (if there is no leak).
With CPU version your RAM is memory which is usually larger than GPU. You have to see how much your model should consume the memory and how much it is actually consuming. If the difference between required and available GPU memory is very small, it will likely through an out of memory error in a few iterations.