stable diffusion memory leak

#71
by wen020 - opened

I have encountered a memory leak problem, we need to store and switch the model of stable diffusion in memory, but when we convert the model in memory to gpu, the memory is not reclaimed, and at the same time, when the model in memory is deleted, the memory also not recycled.
Therefore, what should I do to reclaim the memory occupied by the stable diffusion model.

code:
51739229-1161-4286-9FEB-728C4EA7E976.png

runing log:
FF8085CC-A11A-48C3-94ED-1F5BE84AF27A.png

thank you! i will try it.
But i want to release cpu memory cache.

This only works for GPU memory, but what I noticed is machine memory leak

This issue is caused by torch._C.PyTorchFileReader.
I opened an issue in the PyTorch project repository.

https://github.com/pytorch/pytorch/issues/111330

Sign up or log in to comment