-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
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
Editor: Memory leak when loading 4096x4096 texture several times #21151
Comments
What happens if you load it more than 30 times? Are you able to crash the browser? |
I have created a small example, where I simulate the situation. (~53 secounds - ~53 changes to the same texture) If you use this example without ao change it only change the normalMap. (95 secounds - 95 changes to the same texture) |
Can you please call if ( child.material.aoMap !== null ) child.material.aoMap.dispose();
child.material.aoMap = texture; |
Thanks, that fixes the problem in my example. |
Yes, I guess this is the problem. A quick search shows that |
The biggest question in my mind is at the end, why does the 64 bit browsers crash and 32 bit don't? But for now the problem can be solved by disposing and that's all what matters. |
Describe the bug
I tried to edit the MaterialsVariantsShoe.glb file from the KhronosGroup git in the editor and changed the normalMap and aoMap textures several times to a 4096x4096 texture.
I could use the same texture several times and the memory starts to increase after ~9-10 times (in my tests the value of changes sometimes were even smaller).
That causes the webgl context to crash after enough changes.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
After my analysis this only happens in 64bit browsers.
The following lines of
WebGLState.js
causes the increasment.Screenshots
After 30 changes with the same texture:
Platform:
The text was updated successfully, but these errors were encountered: