Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory Leak in HelloTriangle example #16

Open
macromaniac opened this issue Sep 4, 2024 · 1 comment
Open

Memory Leak in HelloTriangle example #16

macromaniac opened this issue Sep 4, 2024 · 1 comment

Comments

@macromaniac
Copy link

Hi, great project.

In your HelloTriangle.csproj example there is a memory leak caused by not releasing the render pass encoder, view the diagnostic tools window in visual studio and observe the memory go up over time.

Recommend adding on line 383 of HelloTriangle.cs wgpuRenderPassEncoderRelease(renderPass);

@macromaniac
Copy link
Author

macromaniac commented Sep 4, 2024

Also I think wgpuCommandBufferRelease(command); on line 393 too, there is still a light memory leak (.8 MB a minute), no clue where its coming from- it could be in the underlying lib, but it is 10x better with these two lines added

edit: seems like the .8 MB a minute is very likely a known wgpu bug that should be fixed in the next version, I found a workaround by releasing the underlying surface texture every frame but it is a bit ghetto so probably we shouldn't worry about it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant