Skip to content

PSA - Add Swap and Your Linux Box won't crash when switching models

I rebuilt my Ubuntu box which only has 16GB of RAM and everytime I switched checkpoint models in Automatic1111 Linux would freeze up or crash. After some diagnosis I found that I was running out of memory and didn't have enough swap. If this is happening to you, here is how to add more swap space.

https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-22-04

And it even gets bigger with control net, which wants another 16GB of RAM. Combined stable diffusion + control net = 40GB of RAM usage. On my 16GB machine RAM is Full and SWAP is at 30GB.

MiB Mem : 15900.2 total, 161.5 free, 13507.7 used, 2231.0 buff/cache
MiB Swap: 30517.6 total, 17671.8 free, 12845.8 used. 2060.2 avail Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
189801 mgeorge 20 0 40.9g 12.6g 153264 S 17.9 81.4 6:54.57 python3

​

​

Edited 21 Feb 2023. We only hold this version.

6 points0 comments
Open on Reddit
About this post
Posted
Archived
Edited
Score
6 · 100% up
Kind
Text
ID
116uc69

Author

18
posts
63
comments
2
media
View profile
Nobody had commented when we saved it.

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.