Pamac uses up all RAM and crashes compiling from the AUR

I am using Pamac 10.4.2.2 including libpamac 11.3.1-1.

Whem I try to use sudo pamac upgrade it needs to compile some packages from the AUR.
Around 15min into the process pamac uses up all 32GB of RAM and crashes my computer.

Neofetch:
OS: Manjaro Linux x86_64
Host: MS-7C37 3.0
Kernel: 4.19.261-1-MANJARO
Uptime: 35 mins
Packages: 1773 (pacman)
Shell: bash 5.1.16
Resolution: 2560x1440
DE: Xfce 4.16
WM: Xfwm4
WM Theme: Matcha-dark-sea
Theme: Matcha-dark-sea [GTK2/3]
Icons: Papirus-Dark [GTK2], Adwaita [GTK3]
Terminal: xfce4-terminal
Terminal Font: Monospace 12
CPU: AMD Ryzen 7 2700X (16) @ 3.509GHz
GPU: AMD ATI Radeon RX 470/480/570/570X/580/580X
Memory: 1588MiB / 32177MiB

Command run:
sudo pamac upgrade

Result:
Warning: Building packages as dynamic user
Warning: Setting build directory to /var/cache/pamac
Preparing…
Synchronizing package databases…
Refreshing AUR…
Checking python2-six dependencies…
Checking python2 dependencies…
Checking zoom dependencies…
Checking stockfish dependencies…
Checking marvin dependencies…
Checking qt5-styleplugins dependencies…
Checking ceph-libs dependencies…
Checking emulationstation dependencies…
Resolving dependencies…
Checking inter-conflicts…

To build (8):
ceph-libs 16.2.7-1 (15.2.17-1) AUR
emulationstation 2.11.0-1 (2.10.3-1) AUR
marvin 22.18.0-1 (22.13.0-1) AUR
python2 2.7.18-7 (2.7.18-5) AUR
python2-six 1.16.0-6 (1.16.0-5) AUR
qt5-styleplugins 5.0.0.20170311-30 (5.0.0.20170311-29) AUR
stockfish 1:15-3 (1:15-2) AUR
zoom 5.12.2-1 (5.11.3-1) AUR

Edit build files : [e]
Apply transaction ? [e/y/N]

I enter y.
After around 15min of compiling it uses up all my RAM and crashes.
I have no SWAP configured as I didnt think it was needed with this much RAM,

Any thoughts on how to fix this?
This is my first time running into this problem. Im a bit of Linux newbie so I dont get all of the details yet.

Always read #announcements posts. You don’t need at least these packages:

2 Likes

… but if it crashes because of:

you might want to reconsider this thought :wink:

What you can do apart from creating a swap file is:
editing/adjusting /etc/makepkg.conf

here:

#-- Specify a directory for package building.
#BUILDDIR=/tmp/makepkg

so that the RAM based tmpfs (which is backed by swap) is not used, but the disk instead

and perhaps in this section, below

#########################################################################
# PACKAGE OUTPUT
#########################################################################

adjust the paths as well