Comparison of memory usage of different toolkit GUI

Hello! Our team is developing an IDE to work with the TestMace API. In one of our previous articles, readers pointed to the exorbitantly high memory consumption of electron applications. Well, the time of numbers has come :) In this article, the author estimates the memory consumption of single-window applications written using various toolkits. Enjoy reading!

Finding the perfect set of tools for creating a GUI, I decided to measure the amount of memory they occupied.

In fact, I wanted to find out which one requires the least amount of memory for a program consisting of one empty window. In this article I will talk about the results.


This article provides information about the memory occupied by the program when using various tools, frameworks and libraries for creating GUIs on Linux. All measurements were made on the same computer with Ubuntu 19.04 (Disco Dingo) x86_64 using the Ksysguard program, which provides data on the internal memory consumed by applications. I did not reinstall the system specifically for the test. It was executed on my ubiquitous Ubuntu, on which various packages were already installed, which could affect / distort the results.

For some tools, I even added measurements obtained on Windows 10, which can hardly be compared with Linux, but it's interesting to see.

I want to note that my measurements are not of scientific value. Having other initial data, you can get completely different results.

Not as easy as it sounds

So what do we need to measure? Virtual memory (VSZ)? Resident memory (RSS)? Own RSS? Shared RSS?

In short, then ... I believe that when comparing two identical programs developed using different sets of tools, it will be most accurate to measure the amount of internal memory occupied by the process with smaps. Ksysguard uses smaps to display detailed memory information. However, from the very beginning, in my experiment, I used the data from the RAM consumption panel by default, and only then I became aware that smaps give more accurate numbers. In order to ensure data consistency, I used the information from the default RAM panel for all the tools presented in the list, although most likely, using an interface with a detailed description of memory consumption, a similar situation could be seen.

If in more detail, then ... in this article I would not have enough space for lessons on memory management in Linux, and besides, there are already many worthy materials on this topic: ELC: How much memory are applications really using? , The / proc Filesystem , proc - process information pseudo-filesystem , Linux Memory Management Overview , Memory Management

List of tools and their memory indicators

Not a word more. Here are my results:

GUI toolkitOwn memory (MB)Remarks
nuklear (rawfb)0.624does not increase the memory consumed by Xorg
WINAPI (Win10)1.00on windows 10
SDL2 (without opengl)1.10
turbo vision1.30TUI
nuklear (x11)2.200.4 MB + 1.8 MB Xorg memory
LCL (customdrawn)2.50
Gtk + 22.80
wxX113.00not ready for use in production
LCL (GTK)4.50
Gtk + 35.00
JUCE10.00Projucer binary, the window is not empty
Sciter10.00about 10 MB, missing Linux Scapp
nanogui2 p.m.
Sdl2 p.m.
U ++2 p.m.
Agar3 p.m.
Dear ImGUI (SDL)15.30
Dear ImGUI (SDL / Vulkan)16.50
Mono WinForms16.564on windows 10
Qt5 p.m.
Java swing59.30OpenJDK 12
Javafx80.00OpenJDK 12
Flutter desktop98.00upd: in the early stages of development!
Boost.UI-uses wxWidgets
CEGUI-How to collect it? :(?
IUP-similar to wxWdigets, uses gtk + on Linux
Lgi-uses gtk + 2
Minigui-assembly failed
morda-assembly failed
Verdigris-uses qt

I was surprised by the gluttony of Flutter, given that it was originally conceived as a framework for creating a GUI for mobile devices.

UPD (my thanks to kirbyfan64sos ): Flutter Desktop is still in the early stages of development, and all builds are debugging. This means that all profilers (like Observatory) are active, all debug statements are enabled, and the AoT compiler is disabled. It will be interesting to double-check the data using the release build.

I will not say that I was struck by the performance of Electron.

With HorusUI, I was expecting an approximate figure of 20 MB, because it uses OpenGL and the immediate rendering mode of the GUI. I don’t understand why the figure came out more.

Swing and JavaFX Java frameworks have also shown interesting results. Both of them are extremely insatiable, and if you are not sure which one would be suitable for your new Java project, then it seems reasonable to opt for the more convenient and modern JavaFX framework, although you will have to fill it with a little more memory. But if your memory is worth its weight in gold, then, of course, choose Swing.

Qt also showed very interesting figures and was much more voracious than most other popular tools. It is worth noting that most of the memory occupied by it is the amount consumed by the amdgpu driver installed on my system. Maybe this is because OpenGL buffers are stored locally. The same can be seen with SDL2: a program without OpenGL consumes 1.1 MB, and with it as much as 14 MB.

WxWidgets and LCL are well placed in this comparison. Despite the fact that they are wrappers over other tools for the GUI, the cost of resources is minimal. I am impressed with the idea of ​​the possibility of transferring the backend from Gtk +, for example, to Qt, thereby guaranteeing independence from tools.

I’ll also highlight Nuklear, simply because, it seems to me, it has a very cool mode for instant GUI rendering. If you are not confused by the use of the raw X11 framebuffer, your single-window application will occupy only 0.624 MB, which looks very impressive.


If you were hoping to see any generalized conclusions here, then, I am afraid, I have to disappoint you.


All Articles