Not sure why that is, but I have 32 GB of RAM and I would like my system to utilize it as much as possible, but as you can see in the screenshot, the system is only using 5.66 GB of the physical RAM, but swap is still being used in a high number. Is this normal? Should I lower the swappiness to lower than 10? Should I let it be? Thanks
Here is the screenshot

    • Defaults are not always the best setting for a specific user or system. Defaults are often fail safe settings that should work on most systems out of the box. That does not mean other settings aren’t better on your system. Often you can tweak settings to get better results, that are best on YOUR machine and setup.

      But only, if you know what you are doing, or if you want to learn about it.

      • Rogue ( Rogue@feddit.uk ) 
        link
        fedilink
        arrow-up
        15
        ·
        2 years ago

        But only, if you know what you are doing, or if you want to learn about it.

        This is the crux of it though. Sure you can tweak your system but the average users doesn’t know what they are doing or where to learn more.

        I’m not even convinced OP knows what problem they’re trying to solve

      • This reminds me of the (probably apocryphal) Mozart quote where a student asked him to teach them how to write a symphony, and was told “start with something more simple and short, for one instrument”. The student complained “but you have been writing symphonies since you were a child!”. The reply: “yes, but I didn’t have to ask how”.

        The application of this idea here is that for someone to know the requirements for their system to the degree that they can really be sure that the most typical suggestions are not sufficient for them, they probably have to understand how the kernel handles swap and RAM to an extent that they don’t really need to ask this question.

        People are very ready to assume that their system is way out of the ordinary, but it probably isn’t.

  • catloaf ( catloaf@lemm.ee ) 
    link
    fedilink
    English
    arrow-up
    23
    ·
    2 years ago

    You should set it back to whatever it was. It shows 5.6 GB in active use and 19 GB used for cache. You’re already using all your RAM, just not actively. You don’t sit on 100% of the chairs in your house at once either. 3 GB swap used is very low usage, which is expected when you’re not actively using a lot of memory.

    Don’t mess with things you don’t understand, especially when you don’t have an actual problem. You’re going to end up breaking things. (Which, to be fair, is one way to learn, but at the cost of breakage.)

  • It is probably normal. Don’t decrease your swappiness too much.

    I think it happened the following way:

    See the “cached” ram is taking 19 gigs. Theese cached ram improves performance by keeping frequently used system files on ram. So the actual occupied amount of ram would be 5+19 ≈ 25gb. Thoose system files might be used more than other app’s ram so that they have higher priority to be in ram. So at the time you opened certain other applications, the total ram usage including cached might be a little over the availiable ram and likely got swapped. The once swapped thing won’t be cleared immediately or with any much priority. I often see swapped contents remain even after closing a bunch of apps which gave empty space in ram.

    So its just normal but is it using swap without once opening enough apps to fill the availiable space with used+cached? If so I would also be concerned

    • penquin ( penquin@lemm.ee ) deleted by creatorOP
      link
      fedilink
      arrow-up
      6
      ·
      2 years ago

      Damn. I actually didn’t even pay attention to the cached part, nor have I ever even known what it was for. Makes sense now. Thank you.

    • kevincox ( kevincox@lemmy.ml ) 
      link
      fedilink
      arrow-up
      7
      ·
      2 years ago

      The use case will change everything. OP is likely using much more memory than you are (especially disk cache usage) so the kernel decided to swap out some data. Maybe you aren’t using as much so it has no need.

      • penquin ( penquin@lemm.ee ) deleted by creatorOP
        link
        fedilink
        arrow-up
        2
        ·
        2 years ago

        I do have many things running and the CPU is working hard for sure. I didn’t even notice the cached part of RAM. So glad I just upgraded from 16 yesterday. Lol

  • I also have a 32gb RAM (30.5 GiB) and a swappiness value of 10. My entire swap is full and my RAM is only filled up to about 3.8 GiB. However my swap is just 512mb small (its not a typo, it’s half a GB). You should not worry too much, even if the swap is in use, because those parts are probably like “parked” ram area that is not in use for a while now and waiting “to be waken up”. And the performance penalty is not that big, if the swap is on a fast NVME SSD. In old days on old slow spinning hard drives, the penalty for using swap was huge (plus the Kernel and rest of operating system was not fine tuned as today).

    Some related commands to check:

    grep -H swappiness /etc/sysctl.d/*.conf
    
    swapon --show
    
    free
    
    cat /proc/meminfo
    

    Here is an interesting article: https://chrisdown.name/2018/01/02/in-defence-of-swap.html