My computer at work has 16 GB. It gets slow. Every now and then, I'll open a web page that pushes things past a limit. The browser becomes completely unresponsive and sometimes I can't even move my mouse. While I'm suffering from running out of memory, the browser decides to use up even more memory to pop up a dialog to taunt me about it.
This can even happen without user action, for example when a page automatically loads a new ad. The ads on reddit seem particularly bad in this way. Randomly, one will eat all my RAM.
I often end up having to hold down the power button for 5 seconds. That, and pulling the power cord, are the only reasonable recovery. If I get "lucky", as I did a few days ago, Linux will kill the X11 server; this violently shuts down the whole GUI.
I really really hate the situation. I blame most of it on Chromium and Firefox, both of which don't make a serious attempt to keep things under control. A bit of blame goes to the fact that resources allocated in the X11 server can not be easily mapped back to web pages and thus kept within page-specific memory quotas.
If you enable the magic SysRq key, Alt+Print Screen+F will trigger the OOM killer.
Quick enable for those who want it:
kernel.sysrq = 1
in /etc/sysctl.d/90-sysrq.conf.> I blame most of it on Chromium and Firefox
I rarely have this problem with modern Firefox, but also block ads so maybe that makes the difference. Chrome is always bad, though.
The end result is roughly as bad as just rebooting, so I might as well just reboot.
There is no reasonable way to account for the memory.
The "reasonable way" to account for memory is to read the top(1) manual page to find out about the different memory usage statistics, then run top to find out which processes are using how much memory.
Your 66 MB is really low. Maybe your video driver is better than mine.
Fortunately I have a Linux desktop which is my primary machine, but I do still use this quite a lot when I’m working away from my desk.
For my part, whenever my computer is slow, browsers are almost always the cause. I typically restart one or both of my browsers (Chrome/Firefox) when my computer is slow or the fan is whirring like crazy.
--renderer-process-limit=4I almost always find that this is caused by a badly behaved website, not Chrome itself.
Some sites have horribly written JavaScript, or introduce ads that run their own CPU- and memory-intensive JavaScript.
Finding and closing those tabs, or disabling JavaScript, or using uBlock or uMatrix usually solves it for me.
If the question really needs answering, the poster should just get a heap profile. Some instructions are here: http://goog-perftools.sourceforge.net/doc/heap_profiler.html
You may also wish to try the memlog flag to chrome, or rebuild chrome with TCMALLOC_SMALL_BUT_SLOW defined. Warning: it does what it says.
This is exactly the attitude that leads to such problems. Applications that assume they can use all of the available memory on the machine are hostile to multitasking environments.
Entirely unused RAM is a waste if never used.
Yes, you can actually manage RAM more efficiently for your application, if you just reserve a whole bunch of it and work inside of that, but at best you'll trick your users into thinking your applications is fast, but it's not actually in the interest of the user. If they wanted to dedicate all RAM to your application, they would not have opened a second application.
Not the applications.
Caching the output of computation was incredibly valuable to our customers, and the caching that the OS would have done would have had little to no benefit to our customers.
The same could be said for Chrome. Maybe there is value to a globally coordinated OS caching manager, but the OS shouldn't have sole responsibility for caching. Such an approach is clearly suboptimal for the user in at least one use-case (see example above).
Shaming such RAM hogging applications is not just legitimate, it's very much necessary. Otherwise all applications would just reserve as much RAM as they can convince the OS to give them, even if they have no real use for it. There is no checks for this in place, so users need to understand the technical implications and punish RAM hoggers by avoiding them.
If your application can utilize RAM to disproportionally speed itself up and therefore on average speed up the workflow of most users, then that's legitimate, too, and an informed user will see the value.
Chrome has to cooperatively share resources with other applications and with aggressive caching at application level, the only strategy at hands of the OS is to start swapping.
Applied absolutely, it results in deeply sub-optimal behavior in a large number of cases.
Another case could be image decode caching via glide for scrolling lists, or skia output tile caching in a browser, or texture caching in a game engine, or reference frame caching in a video decoder, or glyph caching in a word processor, or block caching in a constructive solid modeller, or result caching in a spreadsheet, or composition caching in a presentation tool, etc. etc. etc.
Caching is an enormously effective tool for applications and operating systems. If an operating system removed it as a tool for applications, it wouldn't likely be a competitive operating system.
Should applications abusively and single-mindedly monopolize memory usage? In some cases, maybe. In general, I think we'd tend to be on the same side of things. I like to see well-behaved applications (that make conservative and efficient use of system resources) and robustly managed operating systems (that don't let apps walk all over them).
If you have very little, it will turn off many optimizations, turn on features that reduce memory (like tab suspension built into the browser), and overall adjust the whole browser to use less resources but go slower.
This is the case. 8 GB of memory, VM takes half of it, Chrome will happily take the rest with few tabs open and lock up my computer.