Let me use a simple example to show the case
import torch 
a = torch.rand(10000, 10000).cuda()  # memory size: 865 MiB
del a
torch.cuda.empty_cache()   # still have 483 MiB

That seems very strange, even though I use “del Tensor” + torch.cuda.empty_cache(), there are still more than half memory left in CUDA side (483 MB in my case above). Is there any approach to totally remove these unused memory from GPU when the old reference is no longer needed?