I have a 2gb RAM / Atom Z3735F / Ubuntu 20.04 machine . My system slows down after waking up from a sleep . Putting CPU governor in performance mode didn't solve the issue . What i have noticed is after returning from sleep state my swap is almost filled out (1.1G/1.3G) and closing every program reduced the swap usage to 600 mb but it didn't went further down . Any help ?
swapon -show
Filename Type Size Used Priority
/swapfile file 4194300 780864 -2
/dev/zram0 partition 524284 524216 100
grep -i swap /etc/fstab
/dev/zram0 none swap sw,pri=32767 0 0
/swapfile none swap defaults,pri=-3 0 0
free -h
total used free shared buff/cache available
Mem: 1.9Gi 1.2Gi 89Mi 316Mi 607Mi 212Mi
Swap: 4.5Gi 1.3Gi 3.2Gi
top
Your problem is that you've got a "2gb RAM / Atom Z3735F / Ubuntu 20.04 machine". You should really be running Xubuntu or Lubuntu.
However, let's try enlarging your swap, and see if it helps.
If
grep -i swap /etc/fstab
returns this...Then do this...
Note: Incorrect use of the
dd
command can cause data loss. Suggest copy/paste.Let's create a swap file of bigger size : -
disable swap and remove existing swap file first
Start by creating a file which will be used for swap:
To make the change permanent open the
/etc/fstab
file:and paste the following line:
You can also enable zram which will make your low memory system even faster by doing these steps :-
Open a terminal window and create a new file with the command:
In that file, add the word:
Save and close the file.
Next, create a second new file with the command:
In that file, paste the line:
Save and close the file.
Next, we need to configure the size of the zRAM partition. Create a new file with the command:
In that file, paste the following (modifying the disksize attribute to fit your needs):
Save and close the file.
open your
fstab
file with this command:and add this line to the bottom:
In order for zRAM to run, we need to create a systemd unit file. Create this file with the command:
In that file, paste the following contents:
Save and close the file. Enable the new unit with the command:
Reboot the machine.
For more info refer to this article on techrepublic.com: How to enable the zram module for faster swapping on Linux