Vulkano: Possible Memory Leak with Descriptor Sets

Created on 7 Sep 2017  路  3Comments  路  Source: vulkano-rs/vulkano

I tried updating to 0.6.2 today, but when I started my game up the fps started dropping rather fast. Seems as if graphics memory is getting allocated constantly. Xorg will eventually freeze which also hints toward a graphics memory leak. I found that https://github.com/vulkano-rs/vulkano/commit/80e965aef51dd860822cfbc86583404a78f707ec caused the issue to start occurring.

I do make many new PersistentDescriptorSet every frame. I am not sure if there is a more proper way to do sets or not.

unknown-cause bug

Most helpful comment

This is happening because descriptor/descriptor_set/std_pool.rs:80 always evaluates to true, so pools are never reused.

It always evaluates to true because descriptor/descriptor_set/sys.rs:121-133 is flawed. That only returns Some(_) if all elements are greater, all elements are equal, or all elements are less. If there is a mix of elements that are greater and elements that are equal, then it returns None.

Pull request incoming to fix this.

All 3 comments

I do make many new PersistentDescriptorSet every frame. I am not sure if there is a more proper way to do sets or not.

Using a FixedSizeDescriptorSetsPool is better if you always use the same descriptor set layout.

Switched to using a pool instead, leaked was greatly reduced and I got a frames boost also.

I just have new persistent descriptors sets made when the window is resized, so hard to tell if the leak was limited to that specific use case. I created the set right before a draw command and then it is dropped right after that before the command buffer is executed. Not sure if that'd cause any issues. I can't seem to find a way to monitor graphics memory usage, so the testing I can do is limited.

This is happening because descriptor/descriptor_set/std_pool.rs:80 always evaluates to true, so pools are never reused.

It always evaluates to true because descriptor/descriptor_set/sys.rs:121-133 is flawed. That only returns Some(_) if all elements are greater, all elements are equal, or all elements are less. If there is a mix of elements that are greater and elements that are equal, then it returns None.

Pull request incoming to fix this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mitchmindtree picture mitchmindtree  路  6Comments

tomaka picture tomaka  路  7Comments

hlavaatch picture hlavaatch  路  6Comments

qnope picture qnope  路  8Comments

SiebenCorgie picture SiebenCorgie  路  11Comments