Freezing when compiling packages, memory overflow suspected

Whenever I attempt to compile a large package or even a simple yay to update everything, I experience a frozen display with total loss of input which lasts for hours, until I eventually need my computer for something else and have to shut it down and reboot. I have experienced this before, but it would always clear up eventually. Within the last week or so it’s been able to go overnight with no change. This has not occurred when I install programs through pacman or when I install binaries. I have tried limiting the CPU threads that makepkg is allowed, but that hasn’t worked. Is there a way to limit the RAM allotted to my compiles? Thanks.

I think you should investigate why your compilations stall
before you attempt to fix the problem by a method you think should work, but which is likely ineffective (if even possible)
and even perhaps proactively give more disk space to your compilations.

I have experienced similar situations with large compilations.
The remedy was to change the directories which are used to store the intermediate data these produce.

By default, there is only RAM and swap and however much is available in tmpfs.

  • take care that there is enough swap space

  • adjust /etc/makepkg.conf
    and have BUILDDIR=/tmp/makepkg
    point to a directory in your /home/$username for example - where there will (probably) be enough space, certainly much more than in /tmp

  • also adjust the locations in the PACKAGE OUTPUT section of that file - point these to somewhere in your /home/$username

Limiting the RAM to solve a problem that is likely caused by already having not enough of it seems to be not such a good idea.

Adding more swap with zram-generator seems to have fixed the problem, thanks!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.