Out of CPU Memory #1357
-
Hello, writing this in reference to a question on SD.Next discord (https://discord.gg/wGtN3x4e): When I let my 800 checkpoints run through on XYZ and let it generate 10x1 image (batch sizes greater 1 give me OOMs on my 4090 with this excercise) I frequently get "CPU out of memory" issues and then webui needs a restart. Havent tracked it well enough for an issue. @vladmandic seems to have investigated on this matter already. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
i've spend counless hours on this. is it a memory leak?yes, its more than possible there are memory leaks, especially in secondary workflows. but in a simple workflows, i cannot detect any memory leaks anymore - up to the point i'm running my setup with gc disabled. but my cpu memory keeps growing anyhow?well, two things:
in theory, python supports other memory allocators, but haven't seen one that actually works what about vram growing?well, it depends on version of torch, it changed several times in the past so yeah, i don't know the actual solution. and if someone finds an actual memory leak, please let me know and i'll jump on it. |
Beta Was this translation helpful? Give feedback.
-
I keep hearing about GC being disabled. What is GC? I've looked in the settings and can't seem to find a GC setting. I have a 4090 so I should have GC (whatever that is) disabled? |
Beta Was this translation helpful? Give feedback.
-
GC is "garbage collect". |
Beta Was this translation helpful? Give feedback.
i've spend counless hours on this.
is it a memory leak?
yes, its more than possible there are memory leaks, especially in secondary workflows.
for example, if you generate an image using 3 loras, but then change 1 lora and generate again? each lora has to restore model layers it modified, but when you have multiple objects modifying same thing, errors can happen.
i just used lora as an example, but same can happen when you have any extension actively modifying underlying data.
but in a simple workflows, i cannot detect any memory leaks anymore - up to the point i'm running my setup with gc disabled.
but my cpu memory keeps growing anyhow?
well, two things:
asyncio
packa…