cancel
Showing results for 
Search instead for 
Did you mean: 

Drivers & Software

Renardjojo
Journeyman III

High memory usage (leak ?) when moving window

Hello !
I am using glfw for an application that needs to stay open for a long time but this application is leaking.
After some research, I saw that the leak was coming from the "glfwSetWindowPos" function.
I made a quick example to illustrate the memory leak:

 

#include <windows.h>
#include <GLFW/glfw3.h>
#include <cmath>

int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pCmdLine, int nCmdShow)
{
    int  frame = 0;

    if (!glfwInit()) exit(-1);

    GLFWwindow* window = glfwCreateWindow(500, 500, "Leak", NULL, NULL);
    glfwMakeContextCurrent(window);
    glfwShowWindow(window);

    while (!glfwWindowShouldClose(window))
    {
        glfwPollEvents();
        frame += 1;
        glfwSwapBuffers(window);
        glfwSetWindowPos(window, std::cos(frame / 100.f) * 50.f, std::sin(frame / 100.f) * 50.f);
    }
    return 0;
}

 

 After 5 minutes, my application allocated 25MB in RAM. 10 minutes later, 50MB was allocated for the above code example.
I tested directly on a release build (run with .exe).
I ran the application on Windows 11.

190223377-6946367d-70f6-4188-999a-53c36050865b.png

Based on Visual Leak Detector, it seems to be a memory allocation (not a memory leak) with std::vector behaviour:

190247347-d4b2cb7b-5935-48a0-ba16-ab03c26878e4.png

Based on the call stack, AMD driver seems to be the issue of this leak, but I can't investigate more with my current skills:

Here are my driver details:

Renardjojo_2-1664453652563.png

Is somebody can confirm the issue or have a solution ?

0 Likes
1 Solution

Try posting your query in 'Communities > Developers' section.

 

Ryzen 5 5600x, B550 aorus pro ac, Hyper 212 black, 2 x 16gb F4-3600c16dgtzn kit, NM790 2TB, Nitro+RX6900XT, RM850, Win.10 Pro., LC27G55T..

View solution in original post

2 Replies
Renardjojo
Journeyman III

Here the missing pictures:

190247347-d4b2cb7b-5935-48a0-ba16-ab03c26878e4.png

190223377-6946367d-70f6-4188-999a-53c36050865b.png

0 Likes

Try posting your query in 'Communities > Developers' section.

 

Ryzen 5 5600x, B550 aorus pro ac, Hyper 212 black, 2 x 16gb F4-3600c16dgtzn kit, NM790 2TB, Nitro+RX6900XT, RM850, Win.10 Pro., LC27G55T..