hoffstadt / hoffstadt/DearPyGui

Memory leak and GUI appears frozen when resizing viewport

Open
#2,477 7 comments 2 reactions 0 assignees View on GitHub
state: pending type: bug
Dominant language
C++
Stars
15.6k
Forks
783
PR merge metrics
No merged PRs in 30d

Description

## 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

```python
# 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()
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.