logoalt Hacker News

magackametoday at 7:00 PM3 repliesview on HN

I think you guys on HN can be a bit out of touch maybe? On my linux machine (measured with tux-manager):

  nautilus                            177 MB
  kitty                               150 MB
  alacritty                           107 MB
  mpv --idle --force-window           160 MB
  winit empty window + OpenGL context 100 MB
  tux-manager                         69  MB
  hexchat                             55  MB
  gnome-terminal                      47  MB
  st                                  12  MB
  xterm                               12  MB
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.


Replies

kvemkontoday at 8:24 PM

> 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:

  GTK4 98 MB
show 1 reply
preg_matchtoday at 7:14 PM

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.

show 2 replies
torginustoday at 7:47 PM

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.

show 2 replies