Linux already uses all the availabe RAM for disk cache. I would rather not an app do that (except in special cases like databases, which know better than the underlying file system what needs to be cached).
If a desktop environment is using a lot of memory, this means the same memory is not available to my other apps. So yeah, even on a 32GB machine, I do care about what each app uses.
As I type this, on my 32GB GNOME system, 21GB is currently in use. Of those gnome-shell uses 2,1GB + another 700MB for gjs and zoom (which I haven't used for a couple days, it just sits in my tray) uses 1,4GB. That's 12% for doing virtually nothing (there are window managers that easily take 5% of the resources of gnome shell and one of these days I'll be fed up enough to switch; and zoom does literally nothing right now except hog memory), and that's just looking at the two top memory users.
My experience with gnome-shell is that it is in fact a huge massive bloat for what it provides. What features does it provide that more barebones window managers don't provide?
How does that work if you run 2 virtual machines, each running Linux?
a virtio balloon is intended to be used in "near OOM conditions" (due to performance implications, mostly)
a normal VM is not doing this.
it's also true that even if it was opportunistic: qemu's memory allocation on the host would take precedence over host filesystem caches which would be consequently evicted.
The reason people really like containers at the moment is partially due to this memory situation, you can "fit" more containers on a host due to better fitting of the memory.
Of course. This is why you need to plan your VM deployments on your system carefully, even if it's just a desktop system.
> it's also true that even if it was opportunistic: qemu's memory allocation on the host would take precedence over host filesystem caches which would be consequently evicted.
A filesystem cache on the RAM is one of the most opportunistic mechanisms in Linux, and AFAICS, the buffers are the least important allocations on RAM, since they can be re-accessed from disk when necessary. So, the ballooning device enters at very high memory pressure scenarios with almost full swap area.
The truth is, you shouldn't be nearing to this point at any of your systems, running VMs or not.
Lastly, a bare bones Linux system w/o a graphical interface needs comparable memory to a biggish daemon, hence when used smartly, they're invisible sans the context switching load they induce on the system.
The way that qemu allocates memory is that generally it allocates 100% of the memory you've given to the VM (sans virtio balloon, which the VM doesn't really know about and will accidentally use for filesystem caches).
This makes qemu-kvm look like a program that uses a lot of memory, and linux (as a host) doesn't know what's happening inside and is not doing anything smart with free memory inside a VM.
This is true with many caveats, such as KSM (kernel-shared-memory), and the nature of virtio ballooning. This is the foundation of how it's working, which is what my parent comment was asking.
Well, i'm obviously in the minority (despite this kind of system programming being my day job for the past 30 years), but JIT'ed Garbage collected languages should never be part of the core system toolkit for actual technical reasons.
gjs (and the kde equivilant) should have been kept as end user system scripting languages, rather than having shipped parts of the DE written in them. Its a large reason why lxqt is significantly lighter than KDE.
It all comes down to the fact that no one has really solved the triumvirate of low latency, reasonable performance, and high collection rates, with a GC that aggressively returns unused ram back to the OS. Its a hard problem when the end application isn't known. For something like a generic control panel the (excluding event/loggging) the upper memory footprint can be bounded by the programmer, and the GC will be more aggressive as it approaches that limit, and the final result is a reasonable compromise. That said the hardcoded limit is likely 2X+ what would have been required by a non GC'ed environment.
But for a general anything goes environment, the GC's are tuned towards performance and largely unbounded GC regions. Which means in order to maintain reasonable performance they will just keep reserving address space from the OS, touching parts of it temporary and then avoiding compacting it because those operations are very expensive. Plus with mozjs/spidermonkey (another whole set of problems for gjs due to the lack of a stable API) if the GC+JIT are aggressive about memory minimization then there can be frequent noticeable application lags as the memory is freed then reacquired from the OS/etc.
Then because your desktop isn't under memory pressure, its not going to page out the fragmented bits of address space by default. Until it is under pressure, then the whole system goes laggy because while the LRU like algorithms the kernel is using to take the memory back work well, the GC is completely unaware of which bits of the address space it thinks it owns are suddenly going to respond much more slowly than it expects, and since its shotgunned (or worse is actually heap compressing everything) stuff all over the address space your taking a lot more pagein requests than one might expect. So the problem gets compounded.
The end result (like with java on the server) is that what benchmarks well in a trivial sandbox by itself on a machine, starts to have longer term negative consequences when its sharing a machine with another application (or dozen) also written under the assumption that address space is free and the OS will just take care of the problem.
So, javascript DE bindings are a good idea, but should have been reserved for windows macro recorder, or vba types of use cases rather than having parts of the default installed runtime env rewritten to use it.
> If a desktop environment is using a lot
> of memory, this means the same memory is
> not available to my other apps.
No, it doesn't mean that.Your mental model of a how an OS allocates and manages memory is stuck in the 60s. Nowadays getting a handle on "real" memory use is increasingly illusive.
Probably the best metric is to ignore it altogether, and instead look at memory churn. I.e. how much the OS ends up having to evict some pages from memory to make space for others.
Even that is only meaningful if it's happening on an ongoing basis. I.e. if your DE allocates 1GB that it uses once (or never) having to evict those pages once generally isn't a problem.
It's only a problem once there isn't enough memory to go around for those pages that are in active use.
So it does mean that.
The fact that I said it plainly instead of mentioning private dirty pages gobbling up most of the available ram so any executable readonly pages need to be evicted / read all the time, thrashing the system much earlier than the OOM killer can kick in, doesn't mean that "if apps take up lots of memory, other apps have less" statement is untrue.
My own gnome-shell has e.g. a 100MB allocation where >95MB is in "Private_Dirty", then a ~200MB allocation where all the columns except "Size" in the "/proc/$(pidof gnome-shell)/smaps" are zero.
People typically exclude the latter category when talking about "real" memory use.
But the former is the sort of thing that would make it into "real" memory use by most definitions, and show up in "RSS".
What I'm pointing out is that knowing that doesn't tell you anything about whether the memory use contributes to memory contention, which is the interesting question.
It's entirely possible (and quite common) that most/all of that was used as a one-off, and is either sitting there unused, or would be swapped out as part of expunging stale pages to disk.
So, you could have a process that at one point used 2GB of memory, and still hasn't free()'d it, but for the purposes of needing to fit a 7GB browser process into a total of 8GB of RAM won't contribute to contention. Even though it "uses" 2GB still (as in "RSS" etc.) it's only ever accessing 100MB of those 2GB. The kernel will happily page out 1.9GB to swap, and performance will be mostly unaffected.
To make any claim about whether an application uses a lot of memory on a modern OS you need to know a lot about its lifetime management of data.
Naively summing up the Size totals to around 9G. I assume that's the measurement you thought I was referencing.
I agree interpreting memory usage numbers on Linux is hard. I also do think modern apps (including here gnome-shell and associated processes) eat up memory like it's unlimited and free.
I am willing to bet, that while Xfce uses less memory than Gnome or KDE, Xfce is also more snappy. I bet smaller memory use and snappiness correlate, while your comment is suggesting an anti-correlation.
The perceived slowness is due to window effects in KDE. Disable these and window appear before you lift your finger from your mouse or enter key.
Lastly, KDE's memory usage comes from the facilities it provides. Disable them if you don't need them, and save a lot of memory. KWin (window manager + compositor) uses ~180MB on a 4K screen, while file manager needs another 57. That's not much.
XFCE is snappy, but annoying due to the 1 pixel window border that you can't ever click on a high DPI display. Mate is almost as snappy and has better UX, so I use that.
My personal experience doesn't mirror what you have said, but sharing personal experiences do not bring us to an objective truth.
I use ALT+ (R/L) click for move resize, so I never interact with borders of windows for a very long time, honestly.
The only time I’ve found KDE not feel responsive was in Kubuntu. I have no idea what is different about Kubuntu vs other Linux distros but the slowness in KDE on Ubuntu is down to Ubuntu and not KDE.
Baloo uses a lot of RAM depending on what you index, but neither Akkonadi, nor baloo takes custody of the processor(s) and degrade system performance.
350MB is not very optimal of course. I may dig the code to see the reasons, tho.
XFCE4 had a similar memory leak ~2 years ago, which was triggered every time screen went into sleep and came back.
So, bugs & shenanigans happens, but I'm not still sure that KDE is "hell of a bloat" considering the things it provides at the speed it provides.
The personal desktop I used to use was regularly suspended to RAM and woke back, and my work system is on 7/24. Both are running KDE, and never misbehaved. They are not lightly used systems either. Also both installations use KDE extensively. Akonadi, Baloo, KIO, etc. are regularly used.
At the end of the day, this is strange.
This is not possible in reality. https://news.ycombinator.com/item?id=24503435
157M kwin_x11 (window manager)
392M plasmashell (desktop shell, widgets and other on screen tools)
175M krunner (macOS spotlight equivalent)
30M kded5 (settings and background daemon)
10M kactivitymanagerd (multiple activity contexts)
40M polkit-kde-authentication-agent-1 (KDE polkit bridge))
25M org_kde_powerdevil (energy settings)
19M kdeconnectd (use mobile phone as remote control)
5M xembedsniproxy (make tray icons work)
13M kaccess (accessibility keys?)
16M ksmserver (Plasma session manager)
41M plasma-browser-integration-host (Firefox can show desktop notifications)
10M kwalletd (password manager)
6M kglobalaccel5 (global keyboard combos)
5M kscreen_backend_launcher (changing screen orientation and resolution?)
2M kio_http_cache_cleaner (?)
32K xsettingsd (apply colour scheme to Gnome applications)
(Some lines omitted since they are not running on my system)
On uninstalling/disabling things:- There's background services menu, which you can control which services to load.
- Baloo can be completely disabled by disabling file search.
- Akonadi is just "Online accounts". Add nothing, it consumes nothing.
- KRunner runs on plugins. You can disable any and every plugin, which will reduce its memory footprint too.
- You can uninstall any KDE feature package (at least in Debian), and these features will magically disappear from KDE interfaces.
Lastly, as another user noted, KDE and Qt has a self-resizing magic, and will try to minimize its memory footprint when the system has low memory. So, you can run KDE on a 4GB system and a 32GB system. KDE will allocate more in the second system, but will evict as much as possible as the memory load increases. Witnessed this in a professional project where we ran KDE on extremely limited thin clients and saw how it behaves.
You didn't actually try this. It makes me annoyed that you think you can go on the internet and just claim something and expect it not be verified; what a bunch of nonsense.
In Debian 11.5, when one tries to uninstall any of kactivitymanagerd, polkit-kde, kaccess, then the package manager also takes out KDE as a whole.
> You didn't actually try this.
No. I tried this and did more. Like using Debian for 15 years, KDE since 3.5.x days or leading a Debian derivative distro's development for 5 years, and deploying that derivative nation-wide from thin-clients to heavy metal.
> It makes me annoyed that you think you can go on the internet and just claim something and expect it not be verified; what a bunch of nonsense.
Same here.
Let's not project our prejudices to others unchecked, OK?
If you want to verify my claims, my webpage is there, with links to anything and everything I do.
So consider you are right and memory usage after boot correlates to being less snappy. That might be just a coincidence, with N being so small, and not a cause. Or maybe there is an interesting, unmentioned cause for both.
Or maybe the higher memory usage is due to features that most users actually want, for example better file indexing for search or whatever. It is not surprising to me that offering less features result in faster systems. In this case the comparison doesn't really make sense.
But it would also not surprise me if a system that uses a lot of memory is faster, if it uses that memory for caching for example.
So we don't know what 'free memory after boot' is a signal of and we don't really know if that is even important. Maybe it is to some who have 4gb or less memory. I have 64gb in my laptop, why should I care? (honest question, I can think of reasons).
If you are going to measure a signal, it is only going to be useful if you have a sound story about what the signal represents and why we should care about it. Otherwise its just a blind ranking game, kind of an e-sports competition, which will perversely incentivize useless investments (of time) and choices.
You bet, but do you have any experience of any kind to back this up or is it just a vague hunch?
In my anecdotal experience, the snappiness of a DE is given almost exclusively by the compositor and amount of CPU cycles and disk I/O ops used by the DE, and less about the RAM used. Of major importance is the input lag of the compositor, with Wayland feeling far more snappier than X11 in most cases.
So I wish more of these tests would investigate CPU usage and disk I/O, rather than these RAM tests where users come to the premature "oh look, DE_1 at idle uses 200MB less RAM than DE_2, so it must be faster" conclusion, which couldn't be more false in the real world usage scenarios of how human users perceive snappiness. There's much more to this than just idle RAM usage.
So to contradict you, no, idle RAM usage does not in any way always directly correlate to perceived DE snappiness.
There is a lot of focus on measuring the system in linux land (cpu, memory, io, etc) from the perspective of a user (and by users), but its actually often the least informative. Developers and operators often benefit more from this level of measurement.
I suspect this is because its much easier to measure system utilization in a standardized way. Maybe this is a nice project to develop user friendly and standardized application level benchmarking for linux desktop (these are more readily available in web development).
one way to probably look at this is as follows: optimising on memory usage f.e. by packing/encoding more information in a limited space, results in reduction of running time of programs. this is because, you reduce the amount of 'stuff' that needs to be moved around in memory (and programs are always doing that).
Gnome does a lot more, and is a lot easier to extend given the JS support, but that has an impact on resource usage.
I don't think this is what TFA is about at all. It is merely comparing resource usage, I don't see it making any other statements. This is useful if you must decide what to use on a less powerful PC.
And my primary desktop is i3, if that tells you anything. OTOH, even when running KDE I tend to use small tools such as leafpad, konsole, vim, etc.
If you have >32 Gb RAM you could ignore DE/WM memory usage but it is a relatively privileged position to be able upgrade hardware faster than software appetites rise.
So, you end up having to do it yourself. Run a tab discard plugin, and then keep an about:memory window open and click the minimize memory utilization button on a regular basis (probably a plugin/etc to do that, but I just trigger it manually every once in a while). And that is on machines that have 32-64G of ram.
The only times it has lacked memory were when GHC autoconfigured into using 2 threads for each CPU core and when I install some memory hungry add-ons on Kerbal Space Program. I never noticed the memory limit on normal usage.
So I for one am very happy with these benchmarks.
>INSTRUCTOR (free)
>STUDENT (free)
>works offline
Yeah that's not a thing when you learn CS.
>use GUI programs.
Yeah please no, it's a waste of time when learning something about server's...i think that's what you teach...well i hope, and if you really really want, tunnel X11-apps...an hell give your students a sandbox! Less inconsistency for you, less waste of time for your students.
I have an account, but I am not validated yet.
On VM resources... FFS, Alpine could run under 128MB of RAM, enough to do basic configurations.
Yes ;) for netbsd and plan9/9front (9p.sdf.org)
Got my account ~3 years ago an validated it immediately, it's fast and simple (at least with paypal).
For plan9 you don't need validation just create a new account (same mail-adress if you will and different pw) https://sdf.org/plan9/
>On VM resources... FFS, Alpine could run under 128MB of RAM, enough to do basic configurations.
Yeah Alpine is really nice...and musl ;)
But the real reason I love XFCE is that RAM use is just a small part of the puzzle of overall weight and resource use, which correlates with performance and responsiveness.
Another correlation, in my experience, is bugs and glitches. It makes sense to me, since more resource use means more code means more places for bugs to appear.
Most of us are slumming it with non-ECC memory I'd wager. In a very real sense, more memory usage corresponds to a larger target for a bit to get flipped by an stray cosmic particle collision.
I think the real reason why XFCE feels so stable and reliable, is that it is old. Old software that doesn't undergo frequent revolutions has a longer time to catch bugs, and doesn't introduce them at the same pace.
I recently saw an article about "maximum viable product" in software, and it really resonated with me.
That's why I always use the Mate desktop: Small footprint, and does everything a desktop environment should: manage your environment & apps, have clean UX, and otherwise get the hell out of your way.
Separately, I'd think you'd want to weigh the memory usage against the utility of the features it enables. The memory is there so that it can be used, of course, but I have a certain memory budget, and I'd rather use that budget on things I care about. So now I can weigh this 1 GiB overhead of Gnome compared to something lightweight against the extra facilities the Gnome provides. I can't think of anything I miss in the lightweight option compared to Gnome, so I'll stick with my lightweight choices.
Are those the only two options?
In any case the memory is technically "used" when dog slow trying to load UI components from disk. It is just not used until that happens. Reminds me of those applications from the dialup days that would "speed up your internet" by loading every link on a page in the background in case you click one of them. In practice they often slowed down your internet by misusing your bandwidth.
Despite what you imply, and despite my own expectations, in actual usage I have observed that the greater the memory requirements of a desktop environment, the laggier it is likely to be in terms of responding to my input. Perhaps it is a mistake to assume that desktop environments' increased memory usage is devoted entirely to readying UI components that would otherwise be stored on disk.
CPU cache is faster than RAM, the more of your OS you can fit there the better and it affects responsiveness.
The framebuffers should be the largest allocation required for a desktop environment.
This page weights in the staggering order of 16MB on Lynx!
Try running Stable-Diffusion, specifically the Automatic1111 version, and merging various checkpoints.
On my 32GB PC, after doing a few merges, the linux kernel is beginning to use many GBs of swap. Further attempts at merging checkpoints can result in OOM kicking in.
If I can save a GB or two, that can help get those final mergings accomplished. Otherwise, it's a case of restarting the application and continuing from there.
An alternative is to keep increasing the available swap space. Mine is at 10GB by default. The problem with that is you can end up waiting for the system to swap stuff in and out, and this can result in system pauses.
The other alternative of course is to buy more RAM. And here was me thinking 32GB was a decent amount ;)
> Overall if you are a user of KDE and Gnome you must be looking at the very least 4GB of RAM though modern web browser eat RAM for breakfast so 6GB or even 8GB of RAM sound a lot more desirable..
Edit: On a general note, the summary of your comment is like "measuring memory is bad – unless it's for <<this objective>>". Even if it's for <<this objective>> it still has to be measured in the first place. There is no need to argue against measuring as it then becomes circularly invalid.
However I might have skipped some problems because I've been on GNOME Flashback for a while, from 2014 to 2020, while I waited for enough extensions to appear to recreated the saner (for me) environment before GNOME 3.
Note that it doesn't (currently) crash, the when a freeze happens it goes on for a while (30s?) and then go away.
Fallacy already starts at this assumption?
And then there is also the one more/bigger whatever I'd want to open and be happy when that is available right away.. memory efficiency also usually often correlates quite perfect with runtime and power efficiency and even responsiveness..
> but on a machine with 8 GiB of RAM, would you not rather see it being used?
Definitely no, wtf is that? :D At least not for the DE that should enable my work..
It's also far less trivial than looking at top output: at minimum you'd want error bars; i.e. repeat the measurement a few times.
At Phoronix KDEs project to reduce memory occupancy has been shown to pay off: in their numbers KDE competes not with Gnome, but with XFCE. If this benchmarks shows a totally different result, at least one of them have a problem.
Also, it's running on a VM, and I assume under software rendering. It might not make a dent for others, but if you add fancy effects like KDE does, then I don't think this is a fair comparison.
Also, memory consumption is measured with `free`, which is even more evidence that not just the DE is measured, but the entire system. They only test Fedora Spins, but that is no assurance the rest of the config is identical between them.
Something about lies and statistics ;) If the proof of the pudding is in the eating, then simply use the DEs of your choice for a while and see what's optimal for you. Don't do silly things like measure memory consumption with `free` on a VM once, and draw general conclusions.
Yes. But not by a desktop.
Also I run it from a flash drive.
Still extremely scary for systems without overcommit enabled, but with overcommit, not terrible.
So I'll have to deal without application blur, but at least the fact that I can blur some things (like the overview) is really nice.
I use lxqt which isn't very impressive but light enough. Awesomewm is really nice too for a tiling environment. The best lightweight was Enlightnment 17, I have no idea why they just dropped off the radar.
This is the first I am hearing about this. Source?
Yes, I would. By the application that does some actual work for me. Not by glorified task launcher.
I know a lot of people who open many many tabs and I believe it can certainly take up to 40-50% of their ram or more, especiallly on 2/4GB machines that are still ubiquitous for people who do not buy a new machine every 3 years.