All these apps are what you would consider native, good apps. Written with Qt, GTK, some in low level langs like C\C++, Rust as well. There is of course different ways to measure the usage and maybe some more testing needs to be done, but stuff like 1-10 MB seems completely unrealistic. I think any empty Qt/GTK app eats 40 MB at least. Only thing that even gets close is st at 12 MB. And mind you it's a terminal (which is 1000x simpler than any modern GUI app, doesn't load any assets etc) and it doesn't even use any GPU accel (which itself seem to add a lot of baseline cost).
Honestly I was a bit surprised myself. I have a Rust winit + ash vulkan hardcoded triangle demo app and it eats 86 MB (the binary itself is 5.5 MB). I would love to know, if anyone could explain why GPU accel seems to eat up so much RAM. Like yeah, there are a bunch of images that live on swapchain, but they should all be in VRAM. Outside of that I don't see what would require MBs worth of overhead.
Yes these are all very, very complex applications though.
But I agree: using more memory is good, actually, because it means more stuff is being cached. Nautilus is probably pre-indexing directory structure so it doesn't have to read disk every single time you open your home folder. That's good. Oh, and thumbnails. Thumbnails are incredibly expensive memory wise, but very useful!
Also modern apps have A LOT built-in. Tons of font management stuff, accessibility, they work on many different environments. I mean, look at everything that goes into a modern terminal emulator.
But... a weather app is much simpler, IMO, than Nautilus or Kitty.
Counterpoint: Nautilus is both slower and less stable than Windows Explorer on large folders, even though the Linux filesystem is much faster. These super-indexed desktop linux search functions are also dog slow, while `grep` and `find` in the terminal are much faster (for searching inside files), and those certainly don't cache anything.
> I think any empty Qt/GTK app eats 40 MB at least.
Classic GTK is (much) better (RSS on Linux):
GTK2 14 MB
GTK3 24 MB
Once it was decided that a desktop application must have fancy animation effects (like on smartphones) and be rendered completely on GPU things got very different:
These apps have codebases going back to the 2000s when having 256MB ram total was a big deal, yet these apps could contend with that (while offering pretty much identical functionality). I remember one of the big arguments for GTK against Qt was that C++ relied heavily on templates, thus every C++ app would have their own copies of the same functions in RAM, while GTK was C, and a lot of those library pages could be shared. Qt even did some nonstandard tricks to cut down on this duplication, which was unpopular with the C++ people.
My Windows 98 install got ten times faster when I went from 32 MB of RAM to 48 MB of RAM.
A fresh boot of my Windows 98 install at the time, once everything was loaded and settled, used up 27 MB of RAM, meaning that after 5 MB of allocations someone was getting paged out somewhere. That extra 16 MB made a world of difference.
Do bear in mind, though, that we're dealing with a lot more than we were back then. Our hardware is more complex, with more and more complex drivers needed to manage more things. Accessibility is different, screens are larger (my monitor now has 27 times the pixels as my monitor then) meaning more memory required for larger textures which are now composited in hardware rather than re-rendered every frame.
I agree with others that things are ridiculous these days, but it's also easy to see that our expectations also need to adjust somewhat. Still, using a webview for displaying the weather... I get why they do it, but it's a scourge. It's emblematic of their care for the customer, which is nonexistent.
AFAIK, Qt's C++ extensions (moc, meta-object compiler) have nothing to do with how it reduces template bloat from containers, which is by moving some type-independent implementation parts to shared methods.
10 MB is not too bad for a GUI app. If the app is full screen, display is FullHD and has 8 bit depth, that's almost 8 MB memory for the back buffer alone. Enable HDR and pixels become 8 bytes RGBA16_Float instead of 4 bytes BGRA8_Unorm, twice as much memory.
True, but many modern computers are using unified memory. On such systems all memory is almost equal, despite often reported differently.
For example, on my 5 years old laptop with integrated AMD GPU, windows 10 calculator in default state uses 33 MB system RAM, 9.6 MB dedicated VRAM. Maximized to FullHD screen, same app uses 36 MB system RAM, 13 MB dedicated VRAM. Maybe the OS counts VRAM as active private working set, maybe the app uses more than 1 buffer.
Regardless of the reason, it’s IMO unrealistic to expect a modern GUI app to consume less memory than required for the frame buffer for its window.
One thing shared between old software rendered desktops and modern videogames is that they shunned these intermediate 'composited' screens. On the desktop, there used to be the screen, and basically windows used to draw on top of each other, there was no intermediate buffer for the whole window to draw itself to, which would then be smushed together with all others.
Video games are the same (mostly) - everything is rendered in screen space for performance reasons, it's very, very rare, that you would render something into a temporary buffer then composite it on top of the rest of the scene - you would need exceptional reasons for that.
Maybe it's time to get back to the olden days of display servers - where applications would push a list of render commands to the 'display server', which would consist of rendering primitives, which would then take these commands and construct the whole UI on the screen, without the intermediate steps of each app drawing into its own little buffer.
You could always fall back to drawing your own applciations, then asking the display server to composite that, but that would pretty much be the exception, not the norm.
These days we have an AI system to do exactly this kind of optimization, too expensive for humans, and too cheap compared to consuming expensive modern hardware
The MacBook Neo has only 8GiB of RAM. This is widely decried as not enough. The RAMpocalypse means that 8 GiB is going to have to be enough or else it'll eat into Apple's margins. The Neos are wildly popular though because people have used it and 8 GiB is fine. So while the singular weather app being smaller itself isn't material, in aggregate, macOS being more efficient is something that lets Apple sell a lower spec product while still justifying a higher price and thus better margins for Apple.
`ansiweather` needs like ~6.28 MiB (measured with `/usr/bin/time -l` on OS X), but it's a bash script that invokes cURL, so there's certainly various overheads there too.
One probably could get this down way below ~1 MiB with a properly tuned straight executable written in C (best not to use any of the "modern" stuff like Rust and Go, their default binary sizes for outputting "Hello, world!\n" are already extreme :-) )
By default anything needs at least 532480 bytes RSS on OSX (I tested it with the most minimal C hello world), so that's a threshold one probably can't beat on OS X at least. We probably could kill that value on Amiga OS with the exact same functionality. :-)
On Linux you can bypass libc and use as little memory as you like. When you don't use libc and don't use dynamic loading there is no strict lower bound although you still start with a certain default stack size.
I'm not sure if you're reply hunting or we talk about different apps but how would you fit the Qt runtime, Javascript runtime, font cache, graphics, networking libraries, etc in this limit? This can't physically be under 70 MB, and more like 100-200+ MB.
Sibling comment called it: these are dynamic libs used by the desktop, so the incremental RAM usage is low. That's a good approach! Makes me wonder what the heck MS is doing to get their app to add an incremental gig to memory usage.
I think you guys on HN can be a bit out of touch maybe? On my linux machine (measured with tux-manager):
All these apps are what you would consider native, good apps. Written with Qt, GTK, some in low level langs like C\C++, Rust as well. There is of course different ways to measure the usage and maybe some more testing needs to be done, but stuff like 1-10 MB seems completely unrealistic. I think any empty Qt/GTK app eats 40 MB at least. Only thing that even gets close is st at 12 MB. And mind you it's a terminal (which is 1000x simpler than any modern GUI app, doesn't load any assets etc) and it doesn't even use any GPU accel (which itself seem to add a lot of baseline cost).
Honestly I was a bit surprised myself. I have a Rust winit + ash vulkan hardcoded triangle demo app and it eats 86 MB (the binary itself is 5.5 MB). I would love to know, if anyone could explain why GPU accel seems to eat up so much RAM. Like yeah, there are a bunch of images that live on swapchain, but they should all be in VRAM. Outside of that I don't see what would require MBs worth of overhead.
Yes these are all very, very complex applications though.
But I agree: using more memory is good, actually, because it means more stuff is being cached. Nautilus is probably pre-indexing directory structure so it doesn't have to read disk every single time you open your home folder. That's good. Oh, and thumbnails. Thumbnails are incredibly expensive memory wise, but very useful!
Also modern apps have A LOT built-in. Tons of font management stuff, accessibility, they work on many different environments. I mean, look at everything that goes into a modern terminal emulator.
But... a weather app is much simpler, IMO, than Nautilus or Kitty.
Counterpoint: Nautilus is both slower and less stable than Windows Explorer on large folders, even though the Linux filesystem is much faster. These super-indexed desktop linux search functions are also dog slow, while `grep` and `find` in the terminal are much faster (for searching inside files), and those certainly don't cache anything.
6 replies →
> Nautilus is probably pre-indexing directory structure so it doesn't have to read disk every single time you open your home folder. That's good
No it isn't good, and no it probably doesn't because it is kernel's job. I'd rather they don't do double caching, and it's actually worse if they do.
1 reply →
> I think any empty Qt/GTK app eats 40 MB at least.
Classic GTK is (much) better (RSS on Linux):
Once it was decided that a desktop application must have fancy animation effects (like on smartphones) and be rendered completely on GPU things got very different:
GTK used to be considered the bloated option along with QT. My first Linux box had 128MB of ram and it was screaming fast.
2 replies →
These apps have codebases going back to the 2000s when having 256MB ram total was a big deal, yet these apps could contend with that (while offering pretty much identical functionality). I remember one of the big arguments for GTK against Qt was that C++ relied heavily on templates, thus every C++ app would have their own copies of the same functions in RAM, while GTK was C, and a lot of those library pages could be shared. Qt even did some nonstandard tricks to cut down on this duplication, which was unpopular with the C++ people.
My Windows 98 install got ten times faster when I went from 32 MB of RAM to 48 MB of RAM.
A fresh boot of my Windows 98 install at the time, once everything was loaded and settled, used up 27 MB of RAM, meaning that after 5 MB of allocations someone was getting paged out somewhere. That extra 16 MB made a world of difference.
Do bear in mind, though, that we're dealing with a lot more than we were back then. Our hardware is more complex, with more and more complex drivers needed to manage more things. Accessibility is different, screens are larger (my monitor now has 27 times the pixels as my monitor then) meaning more memory required for larger textures which are now composited in hardware rather than re-rendered every frame.
I agree with others that things are ridiculous these days, but it's also easy to see that our expectations also need to adjust somewhat. Still, using a webview for displaying the weather... I get why they do it, but it's a scourge. It's emblematic of their care for the customer, which is nonexistent.
1 reply →
In the 2000's 256MB were the bare minimum, my PC in 2002-3 had that.
AFAIK, Qt's C++ extensions (moc, meta-object compiler) have nothing to do with how it reduces template bloat from containers, which is by moving some type-independent implementation parts to shared methods.
> mpv --idle --force-window 160 MB
That's still a HUGE amount when you remember mplayer (which mpv was based on) ran on PCs that has had less RAM than that.
Yeah, most of modern Linux wastes memory too. 100MB for a blank OpenGL context? Ridiculous.
10 MB is not too bad for a GUI app. If the app is full screen, display is FullHD and has 8 bit depth, that's almost 8 MB memory for the back buffer alone. Enable HDR and pixels become 8 bytes RGBA16_Float instead of 4 bytes BGRA8_Unorm, twice as much memory.
2 bit 160x144px ought to be enough for anything
Look at Richie Rich over here with his 2 bits!
This is only relevant if we assume CPU rendering. The article described system RAM use, not video RAM use. Task Manager doesn't combine the two.
They clearly spent it on maintaining their independent Chromium instance instead.
True, but many modern computers are using unified memory. On such systems all memory is almost equal, despite often reported differently.
For example, on my 5 years old laptop with integrated AMD GPU, windows 10 calculator in default state uses 33 MB system RAM, 9.6 MB dedicated VRAM. Maximized to FullHD screen, same app uses 36 MB system RAM, 13 MB dedicated VRAM. Maybe the OS counts VRAM as active private working set, maybe the app uses more than 1 buffer.
Regardless of the reason, it’s IMO unrealistic to expect a modern GUI app to consume less memory than required for the frame buffer for its window.
4 replies →
One thing shared between old software rendered desktops and modern videogames is that they shunned these intermediate 'composited' screens. On the desktop, there used to be the screen, and basically windows used to draw on top of each other, there was no intermediate buffer for the whole window to draw itself to, which would then be smushed together with all others.
Video games are the same (mostly) - everything is rendered in screen space for performance reasons, it's very, very rare, that you would render something into a temporary buffer then composite it on top of the rest of the scene - you would need exceptional reasons for that.
Maybe it's time to get back to the olden days of display servers - where applications would push a list of render commands to the 'display server', which would consist of rendering primitives, which would then take these commands and construct the whole UI on the screen, without the intermediate steps of each app drawing into its own little buffer.
You could always fall back to drawing your own applciations, then asking the display server to composite that, but that would pretty much be the exception, not the norm.
6 replies →
How much money are these companies going to make by reducing their weather app to 1MB, or 10MB? How much is it going to cost them to get there?
The world doesn't run on personal aesthetics, when nobody is willing to pay for them.
These days we have an AI system to do exactly this kind of optimization, too expensive for humans, and too cheap compared to consuming expensive modern hardware
Can AI optimize? All signs point to it writing extensive amounts of unnecessary code
Hey, just a few more years of rising memory prices and it'll actually be a marketing term how much RAM something uses.
The MacBook Neo has only 8GiB of RAM. This is widely decried as not enough. The RAMpocalypse means that 8 GiB is going to have to be enough or else it'll eat into Apple's margins. The Neos are wildly popular though because people have used it and 8 GiB is fine. So while the singular weather app being smaller itself isn't material, in aggregate, macOS being more efficient is something that lets Apple sell a lower spec product while still justifying a higher price and thus better margins for Apple.
Let's not ignore the new "windows copilot laptops" that come with 4GiB.
https://en.gamegpu.com/news/zhelezo/defitsit-pamyati-zastavi...
4 replies →
Apple has been using the "macOS is more efficient" excuse since the early 2000s to justify skimping on RAM.
> The MacBook Neo has only 8GiB of RAM. This is widely decried as not enough.
Bwahahah!
https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...
`ansiweather` needs like ~6.28 MiB (measured with `/usr/bin/time -l` on OS X), but it's a bash script that invokes cURL, so there's certainly various overheads there too.
One probably could get this down way below ~1 MiB with a properly tuned straight executable written in C (best not to use any of the "modern" stuff like Rust and Go, their default binary sizes for outputting "Hello, world!\n" are already extreme :-) )
By default anything needs at least 532480 bytes RSS on OSX (I tested it with the most minimal C hello world), so that's a threshold one probably can't beat on OS X at least. We probably could kill that value on Amiga OS with the exact same functionality. :-)
On Linux you can bypass libc and use as little memory as you like. When you don't use libc and don't use dynamic loading there is no strict lower bound although you still start with a certain default stack size.
The KDE Plasma weather app takes in maximum 1MB.
I'm not sure if you're reply hunting or we talk about different apps but how would you fit the Qt runtime, Javascript runtime, font cache, graphics, networking libraries, etc in this limit? This can't physically be under 70 MB, and more like 100-200+ MB.
Sibling comment called it: these are dynamic libs used by the desktop, so the incremental RAM usage is low. That's a good approach! Makes me wonder what the heck MS is doing to get their app to add an incremental gig to memory usage.
3 replies →
Many of those things are already in memory just from running an empty desktop.
I mean, you're getting dumped on for this, but it seems about right?
For an extreme example:
Inside of a conky widget would do the trick, I think.
https://github.com/brndnmtthws/conky/wiki/Lua:-Shell-Integra...
LOL. it's a beautiful!
Unrelated, but it reminds me of this C64 demo [1] I posted earlier this week: the whole thing in 17.8 KB.
[1] https://news.ycombinator.com/item?id=49205592
Even 1MB is too much. I expect a modern weather app to be <20K.
You'll blow past that if you include any graphics at all.