-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Sprite3Ds with fixed size, low pixel_size, large translation cause explosion in memory usage #31023
Comments
Related to #20855. Sprite3D performs a lot of work every frame, which may explain this. |
If you can build Godot from source, please build the You can also use this Windows 64-bit editor binary for testing. |
@Calinou I've tested it on 3.2.3 today, and it's still happening. Doesn't happen if the translation values stay in the <1E4, maybe <1E5 range (but with the value increasing, the speed visibly drops), but as soon as it hits ~1E6 range, it kills the memory completely. |
@FyiurAmron it actually looks like this is more of an octree issue. In which case it may be fixed by #41123 Are you able to test on a custom build with #41123? Cc @lawnjelly |
Yes I concur, sounds like octree. Try with my PR or naithar's (linked from mine). |
@lawnjelly do you maybe have a Win binary you could share? I have problems with building from source on my box, for a multitude of reasons. :/ |
Sorry I can't make one at the moment as I'm away from home this week. I would test it myself and confirm otherwise. We should have a look at getting at least one of the octree PRs into the 3.2.4 betas soon as it is quite a nasty existing bug which needs fixing, perhaps in beta 2 (I think Akien is building the first soon). |
I can confirm #41123 fixed the attached reproduction project for me. |
Godot version:
3.1.1
OS/device including version:
Tested on different systems with Ubuntu 19 and Windows 10
Issue description:
When spawning many Sprite3Ds with a fixed size texture and a small pixel_size far away from the origin (large values in the translation), an explosion in memory usage happens, up until the whole RAM is filled and the OS either shuts the game down, or the whole PC freezes.
From playing with the parameters, it seems to me like this doesn't worsen gradually - there's a certain threshold where the explosion starts happening, before that all is good.
Whether the explosion happens is a result of a mixture of all three parameters (translation, amount, pixel_size). In fact, with a small enough pixel_size, spawning just one Sprite3D is enough to cause the explosion!
I realize that such large values in the translation don't make sense in a real situation. However, I think the fact that this is somehow related to the pixel_size and the huge memory explosion up to an OS freeze warrant looking into this. I would at least expect the application to fail gracefully, ideally with a hint to the cause. (Debugging this was not fun!)
Minimal reproduction project:
Warning: Running this may crash your PC due to the explosion in memory - terminate the game before the RAM usage gets too high!
TextureLeak.zip
Alternative parameters with just one Sprite3D causing the explosion:
The text was updated successfully, but these errors were encountered: