Your code sample runs just fine on colab 
Also the fact that the memory reported by the OS changed is expected. We use a special allocator that does not return the memory to the OS as soon as it is freed to improve speed.
So the bump here could be due to the change of allocation pattern after the error. But no further increase after that because the pattern remains the same.