Announcement

Collapse
No announcement yet.

Swap Memory Used When There Is Still RAM Available?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Swap Memory Used When There Is Still RAM Available?

    Swap Memory Used When There Is Still RAM Available?

    Hi,

    I am running Kubuntu 14.04 LTS 64Bit fully updated.
    I am using a thin client desktop with only 4GB RAM.
    I am seeing swap memory being used when physical RAM is still available?
    How can I tell Kubuntu to use all physical RAM before using swap memory?

    Thanks!

    Jesse


    #2
    That doesn't mean swap is currently being used, just some was used. Swap isn't automatically purged. Also, the system may duplicate some RAM memory into swap during idle times.

    After initial install, swappiness default is 60. This is too high IMO. Best to do is changing the swappiness to a lower level, like 10 or 1, the result being swap will be used less often Setting it at 0 (zero) will require RAM to completely fill before any swap is used.

    To set your swappiness , edit /etc/sysctl.conf and add the following at the bottom of that file:


    #
    # Swappiness
    vm.swappiness = 10
    vm.vfs_cache_pressure = 50

    Don't forget to leave a blank line (carriage return) below the last line in the file.


    After rebooting the swappiness well be set to 10 and your swap will return to RAM more efficiently. This can be checked by running the following command in a terminal: sudo cat /proc/sys/vm/swappiness. Some people suggest using swappiness = 1 for 1GB RAM and 10 for more than 1GB

    Please Read Me

    Comment


      #3
      Hi,

      Thanks for the instructions.
      I applied the changes to both my thin client desktop and netbook.
      (both with only 4GB RAM)

      Jesse

      Comment


        #4
        Originally posted by oshunluvr View Post
        This can be checked by running the following command in a terminal: sudo cat /proc/sys/vm/swappiness.
        You can also use the sysctl command to read (and write) values at runtime (if you don't want to reboot):
        1. To check value "sysctl vm.swappiness"
        2. To set value "sudo sysctl -w vm.swappiness=10"

        Comment

        Working...
        X