Announcement

Collapse
No announcement yet.

New Low-Memory-Monitor Project Can Help With Linux's RAM/Responsiveness Problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #11
    Once RAM memory is full the operating system is unusable.

    Comment


    • #12
      Originally posted by birdie View Post

      If people also stopped repeating the nonsense that a system cannot run without SWAP, I'd be happy.

      Again,
      • SWAP does not solve this issue.
      • In many cases a system can run without SWAP perfectly. I've been running without SWAP for over 15 years now. 100% of my servers (over a hundred high load machines) run without SWAP.
      • In many cases SWAP significantly decreases performance and responsiveness.
      • In many cases SWAP causes minutes-long stalls.
      • SWAP usage decreases your SSD lifespan.
      • If your system cannot run without SWAP at all, that means your productivity will improve tenfold if you simply install more RAM (if it's possible).
      • But it makes it much rare.
      • It's been demonstrated that for a few years now the kernel struggles in oom situations without swap, I can't remember what change made it so. Clearly you're not running without swap perfectly if OOM situations are freezing your computers more than they should.
      • That's preferable to running out of memory and processing being killed.
      • That's not an inherit problem of swap
      • Your web browser likely causes more writes than swap.
      • Yes, if you're constantly running out of real memory, it's probably a good idea to get more. But if a process suddenly spikes in memory, swap gives that process more emergency room.
      Last edited by Britoid; 21 August 2019, 09:28 AM.

      Comment


      • #13
        How does it compare to nohang?

        Comment


        • #14
          Originally posted by Britoid View Post
          • But it makes it much rare.
          • It's been demonstrated that for a few years now the kernel struggles in oom situations without swap, I can't remember what change made it so
          • That's preferable to running out of memory and processing being killed.
          • That's not an inherit problem of swap
          • Your web browser likely causes more writes than swap.
          • Yes, if you're constantly running out of real memory, it's probably a good idea to get more.
          As much as I hate to admit it because he annoys me to no end, birdie is right. Nowadays, SWAP is a duct-tape fix that is getting increasingly less relevant as RAM capacities get higher and SSDs get more common.
          If you're running several tabs in Chrome on a system with 2-4GB of RAM, SWAP will make your life much easier. If you're playing a game with a memory leak, SWAP is only going to buy you enough time to realize you need to kill the game before your whole system locks up. If you're running something like a renderer and it consumes over 100% of your RAM within a matter of seconds, SWAP isn't going to do a damn thing to help you out.

          Generally speaking, the average new PC these days has a minimum of 8GB of RAM. If any single process needs more than that, chances are, it needs a lot more than that, where SWAP isn't going to save you. This is why it's necessary to find a way to keep a system alive when a memory-hungry process demands more than what can be provided. Even with an NVMe SSD, swapping several GB of data for a single process is going to bring your system to its knees.

          Comment


          • #15
            There have been times where a service misbehaves (like spamd or apache) and the server got to 100% RAM usage. The OS just killed the offending process and kept going.

            In the case of spamd the service must be manually restarted.

            I use no swap.

            Comment


            • #16
              Being stall for ages may be a fine solution for servers out there, but is not for desktop, there is not much that need to be said, swap is not a good enough solution for users that need a more responsive solution. If we are not going to solve this we are choosing to lose the argument for a Linux desktop, must say we are dong a fenomenal work on guaranteeing it. GPU drivers bringing down a desktop is just another example, etc...

              Comment


              • #17
                Originally posted by birdie View Post
                I still can't believe my petty post to LKML has stirred such a commotion and multiple discussions. What's really great is that distros have realized it's a serious issue and taking steps to resolve it. Of course, it would be great to have it resolved right in the kernel but it may take a lot more time than a solution based on user space (of which we already have a few and now one more with a contribution from a RH developer).
                I wouldn't ever suppose it was you. Good job and thanks. When comes to swap I stopped using it years ago and I'm completely fine. However I didn't trigger oom problem.
                Last edited by Volta; 21 August 2019, 10:07 AM.

                Comment


                • #18
                  Originally posted by Britoid View Post
                  • But it makes it much rare.
                  • It's been demonstrated that for a few years now the kernel struggles in oom situations without swap, I can't remember what change made it so. Clearly you're not running without swap perfectly if OOM situations are freezing your computers more than they should.
                  • That's preferable to running out of memory and processing being killed.
                  • That's not an inherit problem of swap
                  • Your web browser likely causes more writes than swap.
                  • Yes, if you're constantly running out of real memory, it's probably a good idea to get more. But if a process suddenly spikes in memory, swap gives that process more emergency room.
                  *What?
                  *Then install more ram. Swap almost never solves OOM situations.
                  *No it isn't... not if the process is going to slog along forever and not complete and or crash anyway... fail early fail often.
                  *Swap doesn't cause any writes if it is never used... which it never is on my systems, waste of SSD capacity....
                  *If a process suddenly spikes it's better that the ill behaved program just die already (and get auto restarted if it is a daemon) instead of locking up the system swapping...

                  Comment


                  • #19
                    file file systems can reserve a percentage for root maybe RAM should to.

                    Comment


                    • #20
                      Originally posted by schmidtbag View Post
                      Nowadays, SWAP is a duct-tape fix that is getting increasingly less relevant as RAM capacities get higher and SSDs get more common.
                      Unless you want hybrid-sleep/hibernation?

                      Originally posted by cb88 View Post
                      Then install more ram. Swap almost never solves OOM situations.
                      What about when you cannot install more RAM? (ie hit the limit the motherboard supports)

                      Spend ridiculous amounts of money to get a whole new system with potential drawbacks just to get the higher RAM capacity instead of allocating some SWAP?

                      How many of you peeps against swap have read this?


                      > There’s also a lot of misunderstanding about the purpose of swap – many people just see it as a kind of “slow extra memory” for use in emergencies, but don’t understand how it can contribute during normal load to the healthy operation of an operating system as a whole.

                      > Swap is a useful tool to allow equality of reclamation of memory pages, but its purpose is frequently misunderstood, leading to its negative perception across the industry. If you use swap in the spirit intended, though – as a method of increasing equality of reclamation – you’ll find that it’s a useful tool instead of a hindrance.

                      > Disabling swap does not prevent disk I/O from becoming a problem under memory contention, it simply shifts the disk I/O thrashing from anonymous pages to file pages. Not only may this be less efficient, as we have a smaller pool of pages to select from for reclaim, but it may also contribute to getting into this high contention state in the first place.

                      Some more from elsewhere:



                      > I think the documentation is making a distinction between swapping and paging, even though on Linux they're much the same (just with different backing devices). Lowering swappiness means that the system will prefer writing out file-backed pages. Increasing swappiness means that the system will prefer writing out anonymous pages.

                      > The actual number of pages written during reclamation is not changed by the swappiness sysctl.



                      > After the kernel decides it's a good idea to ditch a page from memory to disk, it needs to choose which one. It can ditch either a named page (backed by a file on disk) or an anonymous one (data from programs). This controls what it will choose



                      > But what about anonymous pages? The only way anonymous pages can transition from dirty to clean is for them to be written out somewhere. But they can't be written out to the filesystem — they're anonymous, not file-backed. So that's where swap comes in. It's the only place where these pages could be written.

                      > If you don't have swap, those anonymous pages have to live in RAM forever, even though the process is idle. It's not touching those pages. You don't care about those pages. But you're stuck with them, since without swap there's nowhere else for them to go.

                      > With swap, the dynamics of all this mean that idle process' pages will be slowly pushed out of memory, leaving more RAM available for active processes. That's what you want!


                      Comment

                      Working...
                      X