0

I have problems that games on my laptop(CS:GO) take a very long time to load and don't run smoothly, although it used to run smoothly on windows os. (I have converted to ubuntu just a week ago!!)

After some research, I found out that this may be caused by swappiness value. I tried playing around with values on my own but that made it even worse.

By the way, I only have 4GB of RAM and I have set my swap file to 4GB as well.

12
  • Are they the same games in Windows and Ubuntu? Do you have configured drivers for your graphics card? It may not be related to swap. I myself use swappiness of 5 on my laptop with 4GB RAM, so that it would try to use the RAM aggressively. Nov 20, 2020 at 12:52
  • Try a vm.swappiness=80
    – heynnema
    Nov 20, 2020 at 15:37
  • @ArchismanPanigrahi vm.swappiness=5 is TOTALLY wrong for 4G RAM.
    – heynnema
    Nov 20, 2020 at 15:37
  • @haynnema I take care not to open too many browser tabs or not to open too many memory hungry softwares simultaneously. Having large swappiness would make the computer sluggish as I don't have an SSD. Is that a bad idea? Of course, I want to know your opinion Nov 20, 2020 at 15:50
  • @ArchismanPanigrahi (you misspelled my username) Anyway... with only 4G RAM, you want it to swap when necessary. vm.swappiness=5 won't allow that for the most part, and in fact, may cause more lockups with full memory. I'd also set vm.swappiness=80 in your case, and get to use more of your memory, with the slight speed penalty.
    – heynnema
    Nov 20, 2020 at 17:01

1 Answer 1

0

re: "After some research, I found out that this may be caused by swappiness value. I tried playing around with values on my own but that made it even worse."

With 4G RAM and 4G swap, I'd recommend setting vm.swappiness=80.

In terminal...

sudo cp /etc/sysctl.conf /etc/sysctl.conf.BAK # backup the file

sudo pico /etc/sysctl.conf # edit this file

Add this at the end of the file...

# adjust swap vs ram ratio, default=60
vm.swappiness=80

Save the file and quit the editor.

sudo sysctl -p # use the new values

Note: You may be required to add additional memory to your computer. Make sure to configure them as equal size/type SODIMMs.

4
  • the game is now running smoothly but the loading time increased dramatically !!
    – shugran_04
    Nov 21, 2020 at 13:41
  • @shugran_04 setting vm.swappiness really shouldn't effect loading time. Too little memory and a slow HDD could. Maybe you don't fully understand how swap (and vm.swappiness) works. Google it if you wish. Try checking the game loading time immediately after a reboot.
    – heynnema
    Nov 21, 2020 at 13:45
  • the game loads a bit faster after reboot. maybe you are right I think 4gb isn't enough.
    – shugran_04
    Nov 21, 2020 at 13:54
  • 1
    @shugran_04 You could also get a SSD (along with that extra memory) :-)
    – heynnema
    Nov 21, 2020 at 13:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .