hoffstadt / hoffstadt/DearPyGui

Memory increasing and crash if register raw texture and minimize window

Open
#2,049 11 comments 0 reactions 0 assignees View on GitHub
can't reproduce type: bug
Dominant language
C++
Stars
15.6k
Forks
783
PR merge metrics
No merged PRs in 30d

Description

## Version of Dear PyGui

Version: 1.8.0
Operating System: Windows 11

## My Issue/Question

Occupied memory keep increasing and app finally crash, if register raw texture and minimize the app window
(I'm running code from example: https://dearpygui.readthedocs.io/en/latest/documentation/textures.html#raw-textures)

## To Reproduce

Steps to reproduce the behavior:
1. Run the example code (https://dearpygui.readthedocs.io/en/latest/documentation/textures.html#raw-textures)
2. Minimize the app window
3. Wait and check occupied memory

## Expected behavior

Hope memory not increasing when using raw texture and minimize the window

## Screenshots/Video

## Standalone, minimal, complete and verifiable example

```python
# Here's code copied from example
import dearpygui.dearpygui as dpg
import array

dpg.create_context()

texture_data = []
for i in range(0, 100 * 100):
texture_data.append(255 / 255)
texture_data.append(0)
texture_data.append(255 / 255)
texture_data.append(255 / 255)

raw_data = array.array('f', texture_data)

with dpg.texture_registry(show=True):
dpg.add_raw_texture(width=100, height=100, default_value=raw_data, format=dpg.mvFormat_Float_rgba, tag="texture_tag")

def update_dynamic_texture(sender, app_data, user_data):
new_color = dpg.get_value(sender)
new_color[0] = new_color[0] / 255
new_color[1] = new_color[1] / 255
new_color[2] = new_color[2] / 255
new_color[3] = new_color[3] / 255

for i in range(0, 100 * 100 * 4):
raw_data[i] = new_color[i % 4]

with dpg.window(label="Tutorial"):
dpg.add_image("texture_tag")
dpg.add_color_picker((255, 0, 255, 255), label="Texture",
no_side_preview=True, alpha_bar=True, width=200,
callback=update_dynamic_texture)

dpg.create_viewport(title='Custom Title', width=800, height=600)
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.