stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

Try using TCMalloc on Linux by default

Open gakada opened this issue 1 year ago • 3 comments

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.

gakada avatar Apr 13 '23 01:04 gakada

We're not supposed to edit webui-user.*, lest we overwrite everyone's environment variables.

missionfloyd avatar Apr 13 '23 06:04 missionfloyd

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.

gakada avatar Apr 13 '23 18:04 gakada

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.

asagi4 avatar Apr 16 '23 12:04 asagi4

For those who come across this, install TCMalloc via: sudo apt-get install google-perftools

BuffMcBigHuge avatar May 02 '23 20:05 BuffMcBigHuge