vulkano-rs / vulkano

Safe and rich Rust wrapper around the Vulkan API
Apache License 2.0
4.47k stars 435 forks source link

Some examples leaking memory on resize #1898

Open Saetch opened 2 years ago

Saetch commented 2 years ago

Info

Issue

Some examples, including the one in the vulkano.rs guide slowly leak memory if resized. Memory usage is constant if the window is not resized but will steadily increase the more I resize the window. This occurs in the image examples, as well as some others like texture_array and runtime_array, but not in all examples. The ones like teapot and referred do not leak at all for me.

Astralchroma commented 2 years ago

I can confirm that this is an issue, I have had it happen with the triangle example, I thought it was just the fact that I typed it out myself instead of copy and pasting because I was trying to learn how it worked, but after noticing the issue I just copy and pasted it to find it still happens.

Rua commented 2 years ago

@Peter-Crawley what are your system and driver details?

Astralchroma commented 2 years ago

@Rua

Vulkano 0.29.0 OS: Arch Linux x86_64 Kernal: 5.17.9-zen1-1-zen Window Manager: i3wm (X11) GPU: AMD RX580 CPU: Ryzen 2200G Driver: Whatever the latest driver on the Arch repository is.

trevex commented 1 year ago

Tried to reproduce on Windows 10 with NV 1080 Ti (driver 527.56), but on my machine using https://github.com/vulkano-rs/vulkano/commit/10d734955633aad8fe816d5cd12e6f3728749539 I do not experience a memory leak running either image or texture_array.

I tried both resizing through multiple "resize motions" (with mouse up) and frantically dragging the mouse all over the place to no avail.

marc0246 commented 11 months ago

Me and @YouSafe have just observed this on Linux and Windows both using NVIDIA, but only in the teapot example when resizing.

@Saetch @Astralchroma could you please confirm whether this issue still occurs in the latest master with the examples you mentioned or the teapot example?

Astralchroma commented 11 months ago

Never expected I would be mentioned in a PR a year later heh. Anyway, just checked and yes it is still memory leaking on resize in the teapot example. Details below:

marc0246 commented 11 months ago

Thanks a lot! So the issue has been solved for the other examples then?

Astralchroma commented 11 months ago

I only checked the teapot example, I can check others if that would be helpful.

marc0246 commented 11 months ago

Indeed that would be appreciated. The original issue was about examples other than teapot, which seems to have been fixed at some point.

marc0246 commented 11 months ago

False alarm, I can still observe the leaks as well on Windows (but not on Linux), in these examples:

In other words, the examples which draw to a surface and don't leak for me are:

@YouSafe are you sure these don't leak for you on Windows?

This is going to be tricky to debug, especially since there seem to be 3 unrelated leaks going on. Just a heads up: if anyone tests the examples around 0.29, there was a 4th unrelated leak which is now fixed, in the indirect and interactive_fractal examples.