Announcement

Collapse
No announcement yet.

Operating System - slower - Swap Space not used

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

    [DESKTOP] Operating System - slower - Swap Space not used

    Operating System: Kubuntu 20.04
    KDE Plasma Version: 5.18.5
    KDE Frameworks Version: 5.68.0
    Qt Version: 5.12.8
    Kernel Version: 5.4.0-42-generic
    OS Type: 64-bit

    Memory snapshot:
    Total Physical Memory: 5.67 GiB Physical Memory: Free 3% - Disk Cache 28% - Application Data 64%
    Used physical Memory: 21% Total Free Memory: 78%
    Total Swap Memory: 19.53 GiB Free Swap Memory: 19.50 GiB Free Swap: 99%
    Disk buffers: 103.78 MiB Disk cache: 1.61 GiB

    The installation is a few months old and about a month ago the computer suddenly became much slower. (I don't remember what I may have done if anything that this happened).

    Looking at memory information for example just now, Swap is 99% free - I think another time when I checked it was 100% Free.
    During partitioning I had allocated 20 GiB (showing as 19.5 GiB) for the swap. Was this wrong doesn't the OS use the swap now?

    While physical memory is showing only a few precent free, nevertheless only 21% of it is used. Can't the 64bit Kubuntu OS make use of all the memory to show a greater percentage of physical memory free?

    Could there be a virus using up memory?

    #2
    No, and it's not aliens, either!

    Open ksysguard and click on the "CPU %" header to find out what is using your CPU cycles. Click it again if the column isn't showing anything.
    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
    – John F. Kennedy, February 26, 1962.

    Comment


      #3
      What are you using to show free memory? Linux automatically uses free memory as a storage cache and some tools show that as in use.

      Baloo can cause your problem; it gets its index corrupted and floods the system with i/o. Have you got Enable file search checked in system settings? If so, I suggest running "balooctl status" in a konsole a few times; it should be idle most of the time. Also, looking in the baloo directory, ~/.local/share/baloo I think, to see if the index file is a reasonable size compared to the size of your data and its nature. If most of your data are pictures, video and music the index should only be a few 10s of MB at most. Disabling file search would be a good step, and clearing out the directory is a good idea.

      I've never had much luck using system monitors like ksysguard or top to identify the cause of slowdowns. With multi-core processors something can be 100% CPU bound and it's not even noticeable. But it might put you on to the culprit. Checking i/o using ksysguard might give a clue, but you'd have to set up a new tab, then drag the vertical divider from the right to see the "sensors" you can use (I was slow at figuring that out).

      Do you save, and then restore the session at startup? Turning that off and restarting would eliminate a set of possibilities. The chrome browser could cause trouble that way, but I have the vague idea it's improved in that respect.
      Regards, John Little

      Comment


        #4
        Good read: https://www.linuxatemyram.com/
        Kubuntu 20.04

        Comment


          #5
          Originally posted by GreyGeek View Post
          No, and it's not aliens, either!

          Open ksysguard and click on the "CPU %" header to find out what is using your CPU cycles. Click it again if the column isn't showing anything.
          Various applications mostly 1% - 2%
          Firefox uses 1% - 2% but sometimes jumps up to 13%
          There are many unknowns such as kworker which under CPU usages states unknown
          On memory again Firefox is on of the big users fluctuating between 250,000 k and 290,000 k, possibly because I leave tens of tabs open
          web extensions is the next big one with over 200,000 k; thunderbird uses over 160,000 k

          So network applications are using most memory, but my question is why in Info Centre, for example when total memory, hard memory shows 20% used, under physical memory free physical memory is 12% and why Swap is not really being used most of the time showing 100% free.

          Comment


            #6
            Originally posted by jlittle View Post
            What are you using to show free memory? Linux automatically uses free memory as a storage cache and some tools show that as in use.

            Baloo can cause your problem; it gets its index corrupted and floods the system with i/o. Have you got Enable file search checked in system settings? If so, I suggest running "balooctl status" in a konsole a few times; it should be idle most of the time. Also, looking in the baloo directory, ~/.local/share/baloo I think, to see if the index file is a reasonable size compared to the size of your data and its nature. If most of your data are pictures, video and music the index should only be a few 10s of MB at most. Disabling file search would be a good step, and clearing out the directory is a good idea.

            I've never had much luck using system monitors like ksysguard or top to identify the cause of slowdowns. With multi-core processors something can be 100% CPU bound and it's not even noticeable. But it might put you on to the culprit. Checking i/o using ksysguard might give a clue, but you'd have to set up a new tab, then drag the vertical divider from the right to see the "sensors" you can use (I was slow at figuring that out).

            Do you save, and then restore the session at startup? Turning that off and restarting would eliminate a set of possibilities. The chrome browser could cause trouble that way, but I have the vague idea it's improved in that respect.
            Some of what you have said is advanced for me.
            I use Kinfocentre Which shows how much memory there is and gives figures and percentages. I have not used Baloo and don't use chrome as it occupies a lot of memory. I don't save sessions. Just close all applications and shut down the computer every day.
            After reminder from GreyGeek above I also look at ksysguard to see memory.
            Don't understand if the system uses hard disc cash why is there a need for swap when it is left unused. And don't understand why when the computer has so much physical memory (almost 80% free) but in physical memory usage I see only between 3% to 10% free.

            Comment


              #7
              Firstly, on the memory, in KInfocentre -> Memory information, just now my Kubuntu says
              Click image for larger version

Name:	mem-info.png
Views:	1
Size:	22.3 KB
ID:	644877
              It says 264 MiB free, but that big green "Disk Cache" is essentially free, it will be given up quickly if something wants the memory. There's about 12 GiB free. To compare, I edited some text and repeatedly selected all, yank, paste until there was about 8 GB of text:Click image for larger version

Name:	mem-filled.png
Views:	1
Size:	20.6 KB
ID:	644878

              Now, about baloo, it's turned on by default, it's been running unless you've disabled file search. I suggest you at least look in .local/share/baloo (using dolphin you might have to tell it to show hidden files, ctrl-H is one way) and tell us how big the files are there.
              Regards, John Little

              Comment


                #8
                ---------
                Last edited by blueberry; Sep 24, 2020, 02:30 PM. Reason: is not displaying information as formatted

                Comment


                  #9
                  The indexer is showing state: Idle

                  :~$ balooctl status
                  Baloo File Indexer is running
                  Indexer state: Idle
                  Total files indexed: 1,653
                  Files waiting for content indexing: 0
                  Files failed to index: 0
                  Current size of index is 76.05 MiB

                  I found that the apps that I had installed had effected memory. I had uninstalled most apart from dictionary and weather.
                  This time, I kept the dictionary and uninstalled the weather app and it had a noticeable effect in making the computer respond faster.

                  After this I opened various applications and saw memory usage in terminal, it seems the most intensive in my case are the ones that connect to the internet such as browsers and mail
                  :~$ free -m
                  ----------total---used---free---shared---buff/cache----available
                  Mem:--5808---2600--1045----99-------2162-----------2846
                  Swap:-19999---0----19999
                  :~$ free -m
                  ----------total---used---free---shared---buff/cache----available
                  Mem:--5808---2640---948------101----2219------------2804
                  Swap:-19999---0----19999
                  :~$ free -m
                  -----------total---used---free---shared---buff/cache----available
                  Mem:--5808---2826---720------117------2260---------2601
                  Swap:-19999---0----19999
                  :~$ free -m
                  -----------total---used---free---shared---buff/cache----available
                  Mem:--5808---2843---685------127------2280---------2574
                  Swap:-19999---0----19999
                  :~$ free -m
                  ------------total--used---free---shared---buff/cache----available
                  Mem:--5808---3014---325------130------2468---------2409
                  Swap:-19999---0----19999


                  https://www.linuxatemyram.com/ was helpful though I don't understand how big the swap should be and if it is really necessary to have it if disk cashing does not use swap.

                  Comment


                    #10
                    Even with supersized ram in systems these days, there is still a potential need for a bit more room, even if only for extremely brief periods of time. How fast a system can move data into and out of ram, and how much it can use at any speed, is a factor.

                    The need for swap has changed over the years. If one uses hibernation - suspend to disk, you need a swap larger than your ram amount, at least a few Gb
                    If you don't then the need is much less. The installer set me up with a 2gb swap file, which has replaced a separate partition as the default in recent years in Ubuntu
                    My laptop had 8gb ram at the time I installed and I've not notice any issues


                    With very large ram sizes available these days, the old rule of 1.5x ram for swap is a bit ridiculous - I sure ain't gonna allocate 30Gb ( ) to swap!
                    Last edited by claydoh; Sep 24, 2020, 02:36 PM.

                    Comment

                    Working...
                    X