Pamac eating all the RAM

Hi everyone,

I’m just writing to resume and signal a problem (bug?) already signaled (I looked over the forum to post to already opened threads but I could not find one open).
The problem is that when trying to update from Pamac GUI or pamac update the process starts to eat up all the ram. Then after 30 seconds or so it goes back to normal as the pamac process crashes (I think it crashes, at least). Then again after 10 minutes the process repeats.

Here’s a photo (I had to take a picture with my phone because the os was completely stuck):

Also, while trying pamac update from terminal it stucks on Synchronizing package databases..., like this:

[nicola@nicola-desktop ~]$ pamac update
Preparing...
Synchronizing package databases...
Terminated

(I stopped it before my machine would freeze again). While this happens with pamac, pacman seems to work fine:

[nicola@nicola-desktop ~]$ sudo pacman -Syu
[sudo] password for nicola: 
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
 multilib is up to date
:: Starting full system upgrade...
 there is nothing to do

I had this behavior for the first time after a failed update: my internet connection got lost and pacman -Syu got stuck. After closing the process and running the command again I got multiple errors like this:

...
error: could not read db 'extra' (Damaged tar archive)
error: could not read db 'extra' (Damaged tar archive)
error: could not read db 'extra' (Damaged tar archive)