8 ms·
Linux Ate My RAM
- simonblack 5y agoEasy fix. Just download some more RAM till you have enough. https://downloadmoreram.com/ https://downloadmoreram.com/
- brippalcharrid 5y agoUnfortunately, RowHammer mitigations mean that this is not the silver bullet that it once was.
- nousermane 5y agoEasy fix indeed: https://en.wikipedia.org/wiki/zram https://en.wikipedia.org/wiki/zram
- truculent 5y agoIndeed > wait you can actually download more ram if you set up google drive as swap space https://twitter.com/tjhorner/status/1470788584043073542 https://twitter.com/tjhorner/status/1470788584043073542
- rbanffy 5y agoYou can always get an IBM mainframe and pay it under the capacity on demand contract.
- snorkel 5y agotop and free also double count memory footprint of common shared library’s across many processes that are using the same “.so” library. Use pmap to see how much unique memory each process is actually using vs. shared libraries.
- spicybright 5y agoI love single purpose websites like this this. Nice work whoever made this.
- theandrewbailey 5y agoIndeed. It follows the philosophies behind best/better/etc. motherfucking websites, very lightweight, and works without javascript.
- 0xcde4c3db 5y ago> Warning signs of a genuine low memory situation that you may want to look into: > available memory (or "free + buffers/cache") is close to zero > swap used increases or fluctuates > dmesg | grep oom-killer shows the OutOfMemory-killer at work How about this one: the entire system becomes so unresponsive that even a VT switch takes multiple minutes to process, never mind actually logging in and running diagnostics. I don't know exactly why, but I used to get this pretty regularly on a 2 GB laptop if I did the wrong thing in Firefox. The workaround was installing earlyoom [1] (after which the tab would crash instead), although I assume there's some kind of sysfs parameter that I might have tweaked instead. [1] https://github.com/rfjakob/earlyoom https://github.com/rfjakob/earlyoom
- justsomehnguy 5y agoHow about when you can't ssh to the server because ... oom-killer killed sshd? Thankfully that system wasn't mine so I just got a laugh of this situation. Still, 20 years later I still can't wrap my head around why Linux still needs oom-killer when Windows can run just fine without such functionality.
- oshiar53-0 5y agoHint: disable or minimize overcommit and you're good to go.
- justsomehnguy 5y agoThat works for the systems I control. Most of the time I encounter OOM shenanigans on the systems which aren't mine.
- rrss 5y agoI dearly wish overcommit could be disabled per-cgroup, but AFAIK this is not possible. malloc failing seems like a much simpler indication of memory pressure than the alternatives like PSI.
- 5y ago
- commoner 5y agoI remember the Windows SuperFetch* memory caching service getting the same (misplaced, in many cases) complaints for a while after it was introduced on Windows Vista and 7. Unused memory is wasted memory. * https://www.techradar.com/news/software/operating-systems/how-superfetch-makes-windows-faster-639643 https://www.techradar.com/news/software/operating-systems/ho...
- justsomehnguy 5y agoI'm regularly explain what MS SQL doesn't eats up all available memory like Cookie Monster eats cookies. The most recent instance was just a month ago. Though I like when I ask people to explain why their app/service should /not/ use free and abundant memory to serve their users. That short-circuits their brain.
- gruez 5y ago>Though I like when I ask people to explain why their app/service should /not/ use free and abundant memory to serve their users. That short-circuits their brain. here's a reason: because if chrome decides to eat 1GB of memory per tab, and I only have 8GB of ram, then I can't run anything else if I have more than a few tabs open. If chrome could have gotten by with 0.2GB per tab, then it using "abundant memory to serve their users" doesn't actually serve their users, it makes their experience worse. I suppose the system could work if there was some mechanism for the OS to demand that a program free up memory, but I haven't seen that in practice.
- justsomehnguy 5y agoObviously the usual context of the discussion was server workloads, often a single role servers, like a before mentioned MS SQL. > I suppose the system could work if there was some mechanism for the OS to demand that a program free up memory, but I haven't seen that in practice. Memory mapped files works exactly like that, IIRC.
- shrimp_emoji 5y ago>Disk caching makes the system much faster and more responsive! There are no downsides, except for confusing newbies. It does not take memory away from applications in any way, ever! >You can't disable disk caching. I guess I'm lucky I've never been confused by this. All the RAM monitors I've been using (KSysGuard and conky) must be reporting RAM usage accurately.
- BenjiWiebe 5y agoYes, Ksysguard does hide cache usage.
- Const-me 5y agoI wonder have anyone considered fixing that? That's an obvious usability bug of these reporting tools. They should not include disk cache in the "used" memory. Windows does it right. On the task manager graph, disk cache is not counted as used memory. And for experts, there's a separate "memory composition" diagram, with the following parts: in use, modified, standby, and free.
- nix23 5y ago>That's an obvious usability bug of these reporting tools. Not it's a human bug (not knowing enough about your system). >disk cache is not counted as used memory. But it is, and people would be shocked to see that windows uses 17GB of memory after startup ;)
- Const-me 5y ago> Not it's a human bug (not knowing enough about your system). I know enough about my systems, yet I think Windows is doing it right. The numbers reported by Linux, or visible on the “memory composition” diagram in Windows task manager, are borderline useless for everyone except OS kernel developers. Despite I know these hairy implementation details about the ways OS kernel manages physical memory, I don’t really care. When I check these system tools, in 100% of cases I want answer to the question “how much ram my applications could use without swapping”.
- nix23 5y agoIf i go to top i want to know how much free ram i have without touching the filecache, used ram is used ram. >Despite I know these hairy implementation details about the ways OS kernel manages physical memory, I don’t really care. I do, and obviously everyone that implements top and htop etc.
- bagol 5y agoIt's neither bug nor human bug. It is a misconception of those who already familiar with windows, and most of new Linux users are come from windows. Linux folks say that unused memory is not good, of course it is. Windows folks say that free memory is a good thing, and of course it is. See? It actually is the same thing that being seen from different perspective.
- 1_player 5y agoThere's an annoying trend in the newbie Linux world of comparing the RAM usage of different DEs and distros and using that to determine how bloated they are. It keeps annoying me because they conflate cached ram with used ram, and a desktop environment might actually use more ram but be faster in general. Pretty weird to be proud of a DE using ~500MB of ram when you have 16GB. And sometimes some memory usage is percentage based. My desktop consumes a couple GB at boot and as much in caches, but I have 64 of them. Free memory is useless memory. You paid for it, let it work for you.
- nix23 5y agoWhat annoys me most...when they compare it they often completely forget to remove the filecache, like the famous openbsd example. Install OpenBSD then Htop (why why why??) then be astonished that it uses 380MB (350MB of that is filecache and isn't shown as cache in Htop)
- _8j50 5y agoSomeone really needs to call this out properly for the b.s. it is. I had to dd copy very large files that caused the cache to fill up and eat ram, the whole system would come to a crawl. Copy thousands of multu gig files while using firefox, I dare the author! 22GB+ free ram and still can't handle it. It really needs a way to control n% of ram so that absolutley no vfs caching whill happen on that percentage of ram.
- tails4e 5y agoI've hit heavy swapping cases a few times on my home linux box and was dissapointed in oom killer. I wanted it to kill something so I could get my system back, but it didn't seem to trigger. Instead the system became progressively more unresponsive until basically all UI updates stopped. I tried switching to a console prompt but even that was like molasses. Does it only kick in when the swap is so full? If so then perhaps it's a bit late as things so down so dramatically as swap nears being full, it may not be able to become full as the system grinds to a halt. I'd be interested to hear what experiences others have had with oom-killer