WinBox 4 uses a lot of video memory on a 6K display (~500 MB per window)

Hi everyone,

I’ve been using WinBox v4 for more than 2 years. I like that it runs on Windows, Linux and macOS. However, I’ve noticed that it uses a lot of video memory on a 6K display under Windows, around 500 MB per window.

I often have 10+ windows open at once to work on different devices. With that many, the performance of my desktop starts to suffer.

My setup:

  • WinBox version: 4.4
  • OS: Windows 11 Pro (26H2)
  • GPU / driver: NVIDIA GeForce RTX 5080 / Nvidia Studio Driver v.617.42
  • Display: 6K (6016×3384) HDR, scaling 200%
  • How I measured: Task Manager → Performance → GPU → Dedicated GPU memory

Questions:

  1. Is there a setting or optimization (for example a rendering or scaling option, or a launch parameter) that reduces video memory usage per window?
  2. How can I report this to the MikroTik development team so they can investigate? Is there an official channel for WinBox bugs, and what information should I include?

Thanks in advance!

Here's their jira ticketing system portal that they use most of the time, i had the best luck in stuff getting resolved and acknowlaged.

Good luck!

WinBox 4 uses QT 6 which by default under Windows uses the 3D acceleration in Direct 11 mode and the visible content of each sub-window (of WinBox, and maybe some individual GUI elements on those sub-windows) has to be presented as textures. And unlike with games, those textures cannot be lossy compressed because you don't want to see wrong colors or compression artifacts when showing text and GUI details.

So, the bigger the windows, the more GPU memory is required for the textures. And normally the GPU memory usage also increases with each sub-window opened inside WinBox (and also depends on their sizes). But when you are still at the start screen, there is only 1 window. Then you also have things like front/back buffers that are window size dependent too. If you maximized the WinBox window on your 6K screen, then the two buffers alone already consume 2×6000×3350×4 (4 bytes per pixel) ≈ 160MB GPU memory. Depth buffer might also be required, which is at least 2 bytes per pixel per buffer.

You should install the Microsoft Sysinternals Suite Sysinternals Suite - Sysinternals | Microsoft Learn (use the Microsoft Store link on that page so that updates are managed by the store). Then run Process Explorer which is part of the suite. It allows you to view the GPU memory usage for each WinBox process. On my Windows 11 installation with WinBox 4.5rc2 maximized on a 2560x1440 monitor, this is the GPU memory usage on the start screen:

So, for your 6K screen with 5.5× the number of pixels compared to mine, 470MB dedicated GPU memory per WinBox window is just bit higher than the extra polated value of 81 MB × 5.5.

Of course, when I log in and WinBox is showing 11 sub-windows of different sizes, the GPU memory will increase accordingly (but not 11× of course)

However, are you sure that the laggy behavior is caused by this GPU memory usage? Your RTX 5080 is very powerful, and sits at 0% utilisation when you have the 12 WinBox 4 instances open. The dedicated GPU memory still has spaces available, and normally when demand increases it would shift part of the allocated GPU memory to the system RAM (Shared GPU Memory).

Anyway, you can play with a few environment variables described here (set them under the command line and then start WinBox.exe from the same command line)

Qt for Windows - Graphics Acceleration | Qt 6.11

Don't set QSG_RHI_BACKEND to opengl. Doing so will drastically increase the GPU memory usage:

But you can try to enable the software, non-accelerated, rendering mode by running set QSG_RHI_PREFER_SOFTWARE_RENDERER=1. Running WinBox 4 with that environment variable set will use no dedicated GPU memory at all:

But of course, the system RAM usage will increase accordingly, and because GPU hardware acceleration is not used, the main CPU must do all the rendering work, and with the huge number of pixels of your monitor, the WinBox GUI might become very sluggish (but Windows and other running apps will not be affected and will have more GPU memory to themselves).

Maybe don't maximize all 12 WinBox windows at the same time, only the one currently being interacted with?

Why does it use 3D acceleration?

Thank you!

The 12 full-screen windows were just an example to capture and show the behavior. In daily use I run WinBox at various window sizes, sometimes across two displays in parallel. My goal was to present the issue I observed, and your reply is very helpful and informative.

I’ll try all of your suggestions and see which one works best for me.

Regards

Because, the way it’s designed, it’s a game for brats,
rather than a clean from frills and professional app for configuring equipment.

WinBox 4 seems to use Qt Quick/QML.
QML doesn't render native OS text. It's a hardware-accelerated rendering pipeline. It's like drawing a spreadsheet using a game engine.

WinBox is what, 90% text?. Forcing that through a hardware-accelerated game engine is why we're seeing VRAM usage so high and blurry text. It’s an incredibly inefficient choice.

Same as Windows since Vista with DWM and Aero (except for the "basic" mode in Vista/7 that didn't need 3D acceleration and was like WinXP/2000/9x, but that's no longer available since Windows 8) or Linux with since a couple of decade when you used things like Compiz since 2006, or macOS even before that with Quartz: Compositing.

First let's talk about WinBox 3: to display its user interface elements, WinBox 3 uses the old Win32 API with 40-year old mechanisms for drawing UI controls that dated back to the 80s, from even before Windows 3.x. There is a UI thread that runs a loop that listens to "messages" sent to "windows" and dispatches them. Under Win32, windows are not just the big application window, but even elements like sub-windows, labels, buttons, input boxes, etc... (all those rectangular stuffs that you see on the WinBox 3 interfaces) are windows that reacts to the messages.

One of the most important messages that they need to handle is WM_PAINT (which has been called like than since even before Win32, Windows 3.x that was 16-bit already had that WM_PAINT message). The message usually has parameters that contains the rectangular coordinates of the part of the screen that needs to be repainted and when a window (which can be a button) receives that message, it should draw that rectangular part of itself (by drawing text, filling background, draw icons, and other operations using the GDI API).

Let's look at this GIF of a WinBox 3 Interfaces sub-window being dragged in front of a bunch of other sub-windows:

winbox3-ui-drag

Below is a zip file as attachment that contain the original .mp4 file that you can use to seek/pause the screencap video.

winbox3-ui-drag.zip (2.3 MB)

When that Interfaces window is moved to another position, not only parts of it like the border and title bar need to be drawn, but also the tabs, the toolbar buttons, the table contents, the status bar, etc... That's a bunch of "windows" all responding to WM_PAINT telling them to redraw at a new position (new rectangle). They will make a bunch of GDI calls to draw texts, lines, fill rectangles with some color, output some graphics for the icons, etc... All that happens on the CPU in a single UI thread, sequentially.

But when that Interfaces window is moved, the places that it previously occupied are revealed, and there are parts of other windows below Interfaces that are now visible (like the Log or the Resources window). Pixels that are previously drawn by the Interfaces window now need to be replaced with the content of those windows. This is the "invalidation" process, it involves sending a ton of WM_PAINT to all those other windows, so that they redraw their parts that was previously obstructed. So they will call a bunch of GDI method to draw text, fill color, output bitmaps, etc... And all of that of course also happens on the same UI CPU thread, in sequence.

When I move the Interfaces windows across, all those operations must be performed over and over, the same text needs to be re-rendered hundreds of times, by the CPU. All single threaded. It's very inefficient and uses a lot of CPU. But most importantly, when the CPU cannot keep up, the CPU thread is locked at 100%, the UI lags horribly and the screen tears.

If you pause the video or the GIF, you see snapshots like this:

Where Interface is already at the new place, but the Log window is not yet able to process its WM_PAINT so you see the left-over of the old Interface placement. Or worse, this example:

Because the table is itself a window that needs to process its own WM_PAINT, you have the situation here were the table content has not rendered, and you'll see the old content that even includes the old toolbar.

Not only when drawing, every time you close a sub-window, or move one window over the other, new parts of the UI need to be invalidated and repainted with with a lot of WM_PAINT messages being sent.

So, it's laggy, it uses a lot of CPU, single drawing operations (draw text, fill color, draw lines, etc...) needs to be repeated over and over. Very inefficient and the experience is suboptimal.

A solution is to buffer the content of the sub-window. Memory is allocated to store the bitmap image of each sub-window. Instead of drawing directly, the drawing operations (draw text, draw lines, fill rectangle, draw bitmaps, etc...) output to this buffer memory. Now when you move windows/sub-windows around, or move one window to the top of the others, no text or lines need to be re-rendered, just the parts of the bitmaps (that caches the content like a photo) need to be put at the location on screen. Like when you reorder or move a stack of photos.

That's what "compositing" is in a nutshell. All modern UIs, desktop and mobile, make use of that.

Now of course, handling a lot of bitmaps with the CPU involves a lot of memory copying or moving and is also not very efficient, especially when there are millions of pixels. What is very very fast and efficient at handling huge bitmaps? The GPU of course. If you consider a rectangular picture as just two triangles (which a 3D GPU can process billions per seconds) with a texture applied (again, the 3D GPU can fill gigabytes of textures hundreds of time per seconds), then compositing a few tens of window bitmaps with the GPU, hardware accelerated, is only peanuts compared to playing even simple 3D games (games can have millions of triangles to render in a couple of milliseconds).

That's why since the early 2000 (with macOS X) compositing has always tried to make use of the hardware accelerated 3D graphics processing capability of GPU. It much faster and use less power than rendering with the CPU and WM_PAINT. If your WinBox 4 can make use of 3D GPU, you can test for yourself. Drag the same windows as above, or open the window switcher dropdown menu, and move the mouse up and down to switch between WinBox sub-windows, and everything is butter smooth and instant!

And with 3D compositing, you can also apply shader effects very efficiently. When you used the window switcher in previous versions of WinBox 4, you had the blur effect (like Vista). Very little GPU power was needed to do that, because the shaders can normally shade billions of pixels per second, so a few millions of blurred window background are nothing.

Again, if you have a GPU, compositing the UI element is faster and use less power than the old rendering method with the CPU.

But of course, someone like OP with the huge 6K screen needs to scale his GPU accordingly. All the huge bitmaps / textures need GPU memory.

No, it's not text, it's pixels. If you use the CPU to render (please note that since DWM the 2D GDI operations can no longer be hardware accelerated by the GPU), even filling the white background of the table needs the CPU to write bytes into the normal RAM. For OP with his 20-megapixel screen, you don't want the CPU to fill each of those pixels. That's a job for the GPU that is much more efficient.

Modern Windows can only hardware accelerate the drawing operations (even 2D) with the 3D GPU. Direct2D (which can accelerate drawing of 2D elements) needs Direct3D anyway for acceleration. But WinBox 3 also doesn't even use Direct2D, but uses the old GDI. So every pixel of every line, or of the table background, must be drawn with the CPU. Which is very inefficient. Imagine all the CPU cache lines being trashed / evicted because the CPU needs to fill a few tens of megabytes of pixels for the OP's 6K screen.

@smishev How does Winbox3 perform in your screen setup?

WinBox 3 will of course use almost no memory to store the bitmap buffers (because it doesn't store anything like that), so with a 20-megapixel window, no dedicated GPU memory is needed.

But the CPU will need to fill all those pixels. Ask OP to open a log window maximized with 999 lines, and move other tables above that. Even his 4.7GHz CPU will struggle because only one thread is used.

Sure. If the main purpose of WinBox would be "drag windows around with mouse to watch repaint" - then I would favor WB4 rendering engine. But I think the main purpose of WinBox is to look (with human eyes) at the rendered text, which refreshes only every 500ms or even less. This probably does not stress the CPU much.

That's fair. The old rendering of WinBox 3 of course still works when the the content is mostly static, and has the advantage of using less GPU memory. But is probably slower to render its content on screen, especially on today's hi-res screens. and the difference will be more pronounced, when you have more elements on the UI.

Modern GUI frameworks nowadays make use of the GPU, because they render graphical elements, and the GPU excels for that. Qt is no exception here. Even if your app uses Electron or is only a PWA, all of the modern web browser engines use 3D hardware acceleration heavily for rendering.

MikroTik when they started making WinBox 4 probably not only wanted something cross platform (which requires an UI framework other than the old Win32 and GDI), but probably have in mind some more complex and modern UI (maybe even with animations) for future features like CMR. Do you want old, pixelated graphs like what The Dude provided, or something smooth that even shows animation for traffic direction like this screenshot from CoreBit?

All those fancy UI of the browser-based tools recently posted on this forum are possible because the browsers can use the GPU.

If MikroTik sticked to GDI and the old API used for WinBox 3, they would tie their hands and heavily limit their options for future developments.

You are arguing against old GDI, but nobody is asking them to go back to 1995.

The choice wasn't between "CPU cache trashing" and "GPU efficiency." The real choice was between two UI frameworks:

If they used Qt Widgets (a proper desktop framework), they would get hardware-accelerated 2D drawing via Direct2D, and perfectly crisp text via native DirectWrite/ClearType with minimal VRAM overhead.

Instead, they chose Qt Quick / QML (a bloated mobile framework). To render a table, QML builds a 3D-style scene graph where every piece of text and cell is a distinct node and texture pushed to VRAM. QML uses Distance Field text rendering, pushing glyph textures to the GPU Scene Graph. It scales horribly for massive, dense data grids.