stable-diffusion-webui
stable-diffusion-webui copied to clipboard
Try using TCMalloc on Linux by default
Following https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/6722, https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/9323. Can be disabled in webui-user.sh
using NO_TCMALLOC
. Also prints a warning if the library isn't installed.
We're not supposed to edit webui-user.*
, lest we overwrite everyone's environment variables.
Depends on how they do git pull
? It will work if they commit/merge/rebase, otherwise the pull will be aborted, rather than overwriting anything.
I applied this to my installation and it fixed a memory leak issue I'd been having with switching models. The webui no longer seems to randomly OOM if I'm switching between models too quickly. The "steady state" memory usage of the webui also seems to be noticeably lower, though I haven't noticed an actual effect on performance.
For those who come across this, install TCMalloc via: sudo apt-get install google-perftools