How to release ressources for KTX2 textures

Sorry for the delay. It’s been a busy month.

Issue filed: KTX decoder appears to leak memory each time it is used · Issue #11839 · BabylonJS/Babylon.js (github.com)

1 Like

I found two issues with the KTX code and this should fix the memory issues people are seeing.
Once this PR (Fix memory leak and incorrect data copy in KTX2 by bghgary · Pull Request #11846 · BabylonJS/Babylon.js · GitHub) is merged and deployed, we should be good. Sorry for the wait.

3 Likes

I’ve ran the original PG with a count of 3000+ now and haven’t run out of memory. It does appear there is still a very small memory leak which we can tackle at a later point.

1 Like

Hi @bghgary,
I checked the original PG example and it broke on the iPad 12.9, Safari V15 (via Browserstack) after the 4th run.
It seems to work fine on the same device with Safari V14 though.

I was running on a PC. Does it at least work on a desktop?

Yes PC was fine, tried it on my laptop (Win10 / Chrome)

1 Like

The reason why this is failing on iOS is the same as the other thread. I think we can consider this issue resolved. Let me know if you disagree.

If it’s the same issue, I’m fine with closing this thread.
Thanks for you support @bghgary.

2 Likes