DearPyGui icon indicating copy to clipboard operation
DearPyGui copied to clipboard

Memory leak and GUI appears frozen when resizing viewport

Open krrk opened this issue 10 months ago • 4 comments

Version of Dear PyGui

Version: 2.0.0 Operating System: Edition Windows 11 Enterprise Version 23H2 OS build 22631.4751 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz 3.00 GHz Integrated Graphics

My Issue/Question

Memory leak and GUI appears frozen when resizing viewport or when dragging title bar from maximized to windowed mode. The issue doesn't happen every resize or maximize/drag back to window mode but is frequent enough to cause problems. Memory also increases from 65 MB to over 1 GB when the freeze occurs in this sample application. In my real application the memory increases can make the computer run out of memory. Number of triangles also increases after the issue. This seems related to #2049. I can reproduce this with the code in #2049 and with the dearpygui demo or the code below. It also occurs without maximizing but with a resize of the viewport while in windowed mode.

To Reproduce

Steps to reproduce the behavior:

  1. Run the sample code
  2. Maximize and drag back to window mode until GUI freezes

Expected behavior

GUI should not freeze and memory consumption not increase

Screenshots/Video

https://github.com/user-attachments/assets/3e989429-838a-4aba-8f63-b8f24f1046b0

Standalone, minimal, complete and verifiable example

# Here's some code anyone can copy and paste to reproduce your issue
import dearpygui.dearpygui as dpg

dpg.create_context()
dpg.create_viewport(title='Custom Title', width=600, height=600)

dpg.show_about()
dpg.show_metrics()

dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()

krrk avatar Feb 11 '25 21:02 krrk

I have same issue with v2.0.0. When I resize the window, my GUI freezes and I have memory leak. However, I notice it only happens for me when changing vertical size. Horizontal size has no effect for me. Strange thing is if I resize vertically a second time, the window unfreezes. I am using Windows 10.

spartonspartan avatar Mar 05 '25 15:03 spartonspartan

It only happens to me on Windows, not on macOS. p.s. Version 1.11.0 resolves the issue.

PRIMA-LAB-IPU avatar Apr 01 '25 00:04 PRIMA-LAB-IPU

Same issue with Version 2.0.0 on Windows 10 but not on Linux. Due to this bug I had to switch to imgui_bundle.

steve725 avatar Apr 19 '25 13:04 steve725

I've encountered a similar issue on Windows Server 2022, dearpygui 2.0.0 More like the one reported in https://github.com/hoffstadt/DearPyGui/issues/2361 in my case, though Following both in case there are updates :)

paulovcmedeiros avatar Jun 13 '25 12:06 paulovcmedeiros