imgui icon indicating copy to clipboard operation
imgui copied to clipboard

GLFW+OpenGL leaking with/without multi-viewports

Open obqrn opened this issue 10 months ago • 11 comments

Version/Branch of Dear ImGui:

v1.91.8-docking

Back-ends:

example_glfw_opengl3

Compiler, OS:

Windos11 + VS2022

Full config/build information:

No response

Details:

Docking multi-window memory leak Multiple windows appear only when external

Image

Use the official example:example_glfw_opengl3

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

No response

obqrn avatar Apr 24 '25 02:04 obqrn

example_win32_opengl3 no memory leaks

obqrn avatar Apr 24 '25 03:04 obqrn

Do it grows while resizing the OS window, or simply while running without interaction?

Update drivers and check for Malware such as Nahimic. See #8571.

example_win32_opengl3 no memory leaks

But this is quite interesting. Can you check sdl2_opengl3 and sdl3_opengl3 examples as well?

ocornut avatar Apr 24 '25 12:04 ocornut

Colleague driver no problem, but I am the latest version of Windows 11, do not rule out my driver problem. Do nothing, just use the official example. Multiple windows need to be dragged outside the main window. example_win32_opengl3 no problem, I didn't install Nahimic. example_sdl3_opengl3 have the same problem, and small window can not be out of the main window problem.

obqrn avatar Apr 27 '25 01:04 obqrn

This is interesting because I experience a similar memory leak on Windows 11. But not when I the run same executable on Windows 10....

I'm also running GLFW however I'm not using multiple viewports.

RAM usages increases at a steady rate of about 17 MB/min in Windows 11.

jaapiyo avatar Apr 27 '25 13:04 jaapiyo

I didn't install Nahimic.

Most people do not install it intentionally. A lot of the time it is installed automatically by Windows Update for devices which support it. (In particular, SteelSeries headsets, some MSI/ASRock motherboards, and some Lenovo Legion laptops.)

The easiest way to check if it got injected is to check the Visual Studio Modules window for NahimicOSD.dll.

PathogenDavid avatar Apr 27 '25 17:04 PathogenDavid

I have just confirmed that the issue is not with caused by the Windows version. I've created a W10 and a W11 virtual machine and both show no memory leak while running the same executable.

Even though I don't do any gaming on my W11 workstation, it is built from gaming PC parts. I have searched for the Nahimic DLL but can't find it on my system. I do expect something like this is causing my program to leak memory on my W11 workstation...

jaapiyo avatar Apr 27 '25 20:04 jaapiyo

The easiest way to check if it got injected is to check the Visual Studio Modules window for NahimicOSD.dll.检查它是否被注入的最简单方法是检查 Visual Studio Modules 窗口是否有 NahimicOSD.dll

I'm sure it's not installed.

Image

And the use of everything can not be found.

opengl:

Image

obqrn avatar Apr 28 '25 08:04 obqrn

Driver information for my graphics card: Name PNPDeviceID DriverVersion


OrayIddDriver Device ROOT\DISPLAY\0000 17.1.58.818 Intel(R) UHD Graphics 630 PCI\VEN_8086&DEV_3E92&SUBSYS_317817AA&REV_00\3&11583659&0&10 27.20.100.8783

obqrn avatar Apr 28 '25 08:04 obqrn

Image Here is the location of the memory leak function. Hope this helps.

obqrn avatar Apr 28 '25 08:04 obqrn

Here is the location of the memory leak function

Perhaps it would be good to open that tree node to see more things..

Try to set bd->UseBufferSubData = true;

I would love to find a solution. But honestly I believe the general fact is that OpenGL drivers are too unreliable under Windows.

ocornut avatar Apr 28 '25 10:04 ocornut

Here is the location of the memory leak function下面是内存泄漏函数的位置

Perhaps it would be good to open that tree node to see more things..也许打开那个树节点以查看更多内容会更好..

Try to set bd->UseBufferSubData = true;尝试设置 bd->UseBufferSubData = true;

I would love to find a solution. But honestly I believe the general fact is that OpenGL drivers are too unreliable under Windows.我很想找到一个解决方案。但老实说,我相信普遍的事实是 OpenGL 驱动程序在 Windows 下太不可靠了。

The memory tree node is already the deepest. High power is the problem with opengl because my colleague Win10 doesn't have this problem.

obqrn avatar May 06 '25 03:05 obqrn