libsdl-org / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
10.18k stars 1.86k forks source link

SDL3 GPU API, possible memory leak with fences? #11500

Closed failedev17 closed 6 days ago

failedev17 commented 1 week ago

Memory usage increases overtime. leak3

Unresolved allocations is about the same size as the memory increased. leak

and all of the allocations end with the acquire fence function. leak2

It's worse with debug validations on. Would love to have some clarifications on this.

thatcosmonaut commented 6 days ago

Those allocations are coming from the Nvidia driver which we have no control over. Higher memory usage with validation layers on is expected because the validation layers have to do extra record keeping. If there is actually a problem here I need to see a lot more evidence than two heap snapshots because I don't think 3MB of memory growth over 50 seconds is telling me much.

failedev17 commented 6 days ago

Found the piece of code where I wasn't freeing some fences. It was a mistake on my part. Thanks for the reply!

thatcosmonaut commented 6 days ago

The validation layer will always warn you about objects leaking on shutdown, so please pay attention to that.