Page 3 of 3 FirstFirst 123
Results 21 to 27 of 27

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

  1. #21
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    27,817
    Blog Entries
    15

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

    Hi
    You can also see what is used vi a cat /proc/meminfo (and the inevitable man page for proc).
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  2. #22
    Join Date
    Oct 2014
    Location
    Italy
    Posts
    1,763

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

    Quote Originally Posted by nrickert View Post
    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.
    Don't think so Neil, but I play with /etc/sysctl.d/sysctl.conf. Anyway you can see what the system thinks by:
    Code:
    bruno@LT_B:~> cat /proc/sys/vm/swappiness
    60
    bruno@LT_B:~> cat /proc/sys/vm/vfs_cache_pressure
    100
    bruno@LT_B:~>
    Leap 15.1 Gnome on i7 4720HQ + Geforce GTX960M
    testing Leap 15.2Alpha

  3. #23
    Join Date
    Oct 2014
    Location
    Italy
    Posts
    1,763

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

    Please let's not throw numbers without explanation or actual testing. Default values are sensible, unless somebody has good (and tested) reasons to do otherwise. To test that I had to go out of my way to have the system swap with 16GB RAM.
    After firing up a number of VBox VMs I got some 14GB in use without any swap. Then I opened a large image in GIMP and got:
    Code:
    bruno@LT_B:~> free
                  total        used        free      shared  buff/cache   available
    Mem:       16304312    15757864      154780      289484      391668       32476
    Swap:       8388604      598272     7790332
    bruno@LT_B:~> free
    The system went unresponsive for a couple minutes, then resumed normal operation. The interesting bit is that even after shutting down a couple of VMs, most of the swap has not been reclaimed:
    Code:
    bruno@LT_B:~> free
                  total        used        free      shared  buff/cache   available
    Mem:       16304312    11512556     3911520      382548      880236     4131020
    Swap:       8388604      554240     7834364
    bruno@LT_B:~>
    So it seems that the OP exceeded 16GB RAM by just 25 MB one time since boot and that has not be reclaimed back since.
    And we are talking tuning system vm settings to avoid something like that?
    Leap 15.1 Gnome on i7 4720HQ + Geforce GTX960M
    testing Leap 15.2Alpha

  4. #24
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    27,817
    Blog Entries
    15

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

    Quote Originally Posted by OrsoBruno View Post
    Please let's not throw numbers without explanation or actual testing. Default values are sensible, unless somebody has good (and tested) reasons to do otherwise. To test that I had to go out of my way to have the system swap with 16GB RAM.
    After firing up a number of VBox VMs I got some 14GB in use without any swap. Then I opened a large image in GIMP and got:
    Code:
    bruno@LT_B:~> free
                  total        used        free      shared  buff/cache   available
    Mem:       16304312    15757864      154780      289484      391668       32476
    Swap:       8388604      598272     7790332
    bruno@LT_B:~> free
    The system went unresponsive for a couple minutes, then resumed normal operation. The interesting bit is that even after shutting down a couple of VMs, most of the swap has not been reclaimed:
    Code:
    bruno@LT_B:~> free
                  total        used        free      shared  buff/cache   available
    Mem:       16304312    11512556     3911520      382548      880236     4131020
    Swap:       8388604      554240     7834364
    bruno@LT_B:~>
    So it seems that the OP exceeded 16GB RAM by just 25 MB one time since boot and that has not be reclaimed back since.
    And we are talking tuning system vm settings to avoid something like that?
    Hi
    That's why I said to look at meminfo, it could be dirty etc. The only reason I don't use swap is I don't suspend or hibernate... system is either on or off If you are hitting the limits without swap then consider more ram. I'm at 24GB these days because I want to use 8GB for the VM machines when they run.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  5. #25
    Join Date
    Jan 2014
    Location
    Erlangen
    Posts
    1,186

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

    Quote Originally Posted by malcolmlewis View Post
    Hi
    That's why I said to look at meminfo, it could be dirty etc. The only reason I don't use swap is I don't suspend or hibernate... system is either on or off If you are hitting the limits without swap then consider more ram. I'm at 24GB these days because I want to use 8GB for the VM machines when they run.
    Sure, but I encountered swapping on a machine running no graphical logins, but only rsync on a i3-4130 with 8 GB RAM! This never happened before.
    AMD Athlon 4850e (2009), openSUSE 13.1, KDE 4, Intel i3-4130 (2014), i7-6700K (2016), i5-8250U (2018), openSUSE Tumbleweed, KDE Plasma 5

  6. #26
    Join Date
    Oct 2014
    Location
    Italy
    Posts
    1,763

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

    Quote Originally Posted by malcolmlewis View Post
    Hi
    You can also see what is used vi a cat /proc/meminfo (and the inevitable man page for proc).
    Good hint, Malcolm. Quoting from the man page:
    Buffers %lu
    Relatively temporary storage for raw disk blocks that shouldn't get tremendously
    large (20MB or so).
    ...
    SwapCached %lu
    Memory that once was swapped out, is swapped back in but still also is in the
    swap file. (If memory pressure is high, these pages don't need to be swapped out
    again because they are already in the swap file. This saves I/O.
    )
    My wild guess: at some point the OP system was below a few % of free RAM, one of the network apps requested a buffer, the vm allocator swapped 25MB of inactive boot code, then those 25MB remained in the swap and the system worked with more buffer space available thereafter. Inspection of /proc/meminfo could confirm this or not, but understanding that content is not trivial.
    To avoid that, we could even set swappiness=0 but _very_ nasty things happen with that value if you actually hit the limits in free RAM available: the application might simply be killed without warning by the oom killer.
    With swappiness=1 once I got a latency of 30 minutes (no mistake, 30 _minutes_) when the system actually needed swapping a few 100 MB, compared to 1 minute or so with default settings.

    I noticed that in the last year or so the vm allocation code in the kernel has been under active development, so seeing something new in recent Tumbleweed might not be surprising (but I'm not smart enough to tell for sure).
    An interesting reading on the subject for the not faint of heart: https://unix.stackexchange.com/quest...r-is-it-a-myth
    Leap 15.1 Gnome on i7 4720HQ + Geforce GTX960M
    testing Leap 15.2Alpha

  7. #27

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

    Swap is the solution of obsolete computers
    ------------------------------------
    Correct me if I'm wrong .
    ------------------------------------

Page 3 of 3 FirstFirst 123

Posting Permissions

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