Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 34

Thread: 16GB RAM / 10GB Used - Swap File Being Used? How To Stop Swap File From Being Used?

  1. #11
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    12,012
    Blog Entries
    2

    Default Re: 16GB RAM / 10GB Used - Swap File Being Used? How To Stop Swap File From Being Used?

    Quote Originally Posted by JeZ-l-Lee View Post
    Hi,

    Will:
    Code:
    swapoff
    Survive a reboot?
    (need something permanent)

    Let me know, thanks!

    Jesse
    Needs testing, but from the documentation, likely.
    There is a corresponding "swapon" to reverse what swapoff does.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  2. #12

    Default Re: 16GB RAM / 10GB Used - Swap File Being Used? How To Stop Swap File From Being Used?

    Hi,

    I just tested: "swapoff", it does not survive a reboot.
    Is there a method to turn off swap which would survive a reboot?
    Let me know, thanks!

    Jesse

  3. #13
    Join Date
    Dec 2008
    Location
    FL, USA
    Posts
    2,064

    Default Re: 16GB RAM / 10GB Used - Swap File Being Used? How To Stop Swap File From Being Used?

    Quote Originally Posted by JeZ-l-Lee View Post
    I just tested: "swapoff", it does not survive a reboot.
    Is there a method to turn off swap which would survive a reboot?
    Try noauto as a mount option in /etc/fstab? When I use it:
    Code:
    # dmesg | grep -i swap
    [    0.141700] Spectre V1 : Mitigation: usercopy/swapgs barriers and __user pointer sanitization
    [    1.126877] zswap: loaded using pool lzo/zbud
    [    1.675831] systemd[1]: Reached target Swap.
    [    3.020822] systemd[1]: Reached target Swap
    # free
                  total        used        free      shared  buff/cache   available
    Mem:       16273576      180536    15957544        1916      135496    15855824
    Swap:             0           0           0
    Reg. Linux User #211409 *** multibooting since 1992
    Primary: 42.3,TW,15.0 & 13.1 on Haswell w/ RAID
    Secondary: eComStation (OS/2)&42.3 on 965P/Radeon
    Tertiary: TW,15.0,42.3,Fedora,Debian,more on Kaby Lake,Q45,Q43,G41,G3X,965G,Cedar,Caicos,Oland,GT218&&&

  4. #14
    Join Date
    Oct 2014
    Location
    Italy
    Posts
    1,804

    Default Re: 16GB RAM / 10GB Used - Swap File Being Used? How To Stop Swap File From Being Used?

    Not clear to me what the real problem is. As explained in the RedHat article already referenced by tsu2, running Linux without some swap is not a good idea (other than for testing purposes).
    I see three common scenarios.

    1. The system swaps heavily under normal load and becomes unresponsive.
    >>>>Buy more RAM, there is no real alternative.

    2. The system occasionally swaps under peak load, you don't really notice unless you look at system logs (looks like the OP case?).
    >>>>Don't tinker with the default config unless you really, really know what you are doing. (Most users, me included, lack the detailed knowledge to tune a system better than the sensible default config).

    3. The system never swaps under normal load; if swaps happen, there is an application that needs to be killed and/or debugged.
    >>>>Create a sysctl config like suggested in posts #2 or #7, what most of us SSD users do. Please be aware that with this config the system becomes _very_ unresponsive as soon as it starts using swap, so that should never happen in normal use.
    There may be alternative solutions as hinted by malcolmlewis, but the end result is not much different.
    Leap 15.1 Gnome on i7 4720HQ + Geforce GTX960M
    testing Leap 15.2Beta

  5. #15

    Default Re: 16GB RAM / 10GB Used - Swap File Being Used? How To Stop Swap File From Being Used?

    Super confused...

    Used Kubuntu Linux for many years on 16GB RAM desktop and swap file was never used.
    On openSUSE Tumbleweed KDE 64Bit, the swap file is used and there is nothing I can do about it.

    I tried in Konsole:
    su
    nano /etc/sysctl.conf
    ADD TO BOTTOM:
    vm.swappiness=1
    vm.vfs_cache_pressure=1

    Saved an rebooted, but under full load the swap file is still being used?
    Frustrated...

    Jesse

  6. #16
    Join Date
    Oct 2014
    Location
    Italy
    Posts
    1,804

    Default Re: 16GB RAM / 10GB Used - Swap File Being Used? How To Stop Swap File From Being Used?

    Quote Originally Posted by JeZ-l-Lee View Post
    Super confused...

    Used Kubuntu Linux for many years on 16GB RAM desktop and swap file was never used.
    On openSUSE Tumbleweed KDE 64Bit, the swap file is used and there is nothing I can do about it.
    Maybe with TW there is just a peak in RAM usage, some "old" content or buffer is swapped (and maybe never reclaimed) so it sits in swap until the next reboot doing no harm...
    The real question is: do you really notice adverse effects (e.g. persistent slowness) or is it just a nuisance to not see "swap in use =0" in system monitor?

    I tried in Konsole:
    su
    nano /etc/sysctl.conf
    ADD TO BOTTOM:
    vm.swappiness=1
    vm.vfs_cache_pressure=1
    Two things:
    1. /etc/sysctl.conf will be replaced with the next update, copy to /etc/sysctl.d/sysctl.conf for a persistent setting.
    2. A sensible value for vm.vfs_cache_pressure is 50, not 1; even with 50 the system becomes extremely unresponsive if swap is being effectively used, so you should notice.
    As a general rule, don't tinker with those values unless you really know what you are doing; occasional use of swap space is normal and not something to be worried about.

    BTW, what is your RAM usage "under full load"?
    Leap 15.1 Gnome on i7 4720HQ + Geforce GTX960M
    testing Leap 15.2Beta

  7. #17

    Default Re: 16GB RAM / 10GB Used - Swap File Being Used? How To Stop Swap File From Being Used?

    Hi,

    Full load is:
    Memory Used: 9.3GB
    Swap Used: 25MB

    I have the following running:
    - Konsole
    - ExpressVPN running through OpenVPN
    - Pidgin IM
    - Skype
    - Thunderbird Email
    - Firefox Browser
    - Chrome Browser
    - FileZilla FTP Client
    - LibreOffice Calc
    - Steam Game Client
    - AppGameKit Studio IDE
    - VirtualBox
    - Win 10 Pro 64Bit Virtual Machine(4GB RAM)

    Jesse

  8. #18
    Join Date
    Oct 2014
    Location
    Italy
    Posts
    1,804

    Default Re: 16GB RAM / 10GB Used - Swap File Being Used? How To Stop Swap File From Being Used?

    Quote Originally Posted by JeZ-l-Lee View Post
    Hi,

    Full load is:
    Memory Used: 9.3GB
    Swap Used: 25MB
    This is swap=0 to any practical standard. My guess is that an application asked for some buffer space and the system pushed to swap some boot code that it never needed thereafter, to leave as much ram as needed available to buffers, possibly for one of the running network clients or VBox during some peak operation.
    That sounds normal to me and I doubt that you ever noticed; if you don't want to see that 25 MB to swap I think the only option is to switch off swap entirely, but then one of your running applications might be killed sooner than you expect due to poorer memory management when a swap is not available.
    In a situation like that I would not even tweak the default parameters (swappiness=60 vfs_cache_pressure=100) unless I had another valid reason to do so.
    Leap 15.1 Gnome on i7 4720HQ + Geforce GTX960M
    testing Leap 15.2Beta

  9. #19
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    13,311
    Blog Entries
    3

    Default Re: 16GB RAM / 10GB Used - Swap File Being Used? How To Stop Swap File From Being Used?

    Quote Originally Posted by JeZ-l-Lee View Post
    I tried in Konsole:
    su
    nano /etc/sysctl.conf
    ADD TO BOTTOM:
    vm.swappiness=1
    vm.vfs_cache_pressure=1
    I'm not sure if it matters in this case. But that file is probably copied into the "initrd". You could try running "mkinitrd" to recreate that.
    openSUSE Leap 15.1; KDE Plasma 5;
    testing Leap 15.2Alpha

  10. #20

    Default Re: 16GB RAM / 10GB Used - Swap File Being Used? How To Stop Swap File From Being Used?

    I have been working for 5 years without swap files, however open the terminal
    Code:
    su -
    enter your password

    Code:
    kate /etc/sysctl.conf
    if you have Gnome use gedit, at the bottom of the file add
    Code:
    vm.swappiness = 10
    reboot
    ------------------------------------
    Correct me if I'm wrong .
    ------------------------------------

Page 2 of 4 FirstFirst 1234 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •