-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
ever-increasing memory usage -- specially on WASM #4851
Comments
This was the conclusion from our Discord conversation on the matter. |
@flipbit03 when you get the chance, can you expand on my summary? |
@alice-i-cecile @flipbit03 where is the discord conversation? |
The |
So the reason for the leak seems to be Chrome performance instrumentation code rather than bevy app code. Apparently calling performance.clearMeasures() and performance.clearMarks() clears (most of?) the memory used for tracking memory usage (ironic right?) and so this was not a bevy problem. |
rustwasm/wee_alloc#106 is this related? |
Thx @Niedzwiedzw, removing wee_alloc worked for me. |
wowowow, really? I haven't tested yet, gonna do that when I grt home |
@Tarnadas, just to clarify, were you using wee_alloc in your own program and removing it fixed it? We don't appear to use wee_alloc in Bevy itself. |
Yes I was using it in my own program, because almost every WASM guide suggests to use it, if you want to shrink binary size. |
The savings fron using wee_alloc instead of the default dlmalloc are neglectible in comparison with the size of bevy itself. In addition wee_alloc is slow and suffers a lot from memory fragmentation. |
Bevy version
0.7.0
Operating system & version
Windows 10, Ubuntu 20.04, also WASM
What you did
Ran my game for a hour while checking world entity count and other stuff, which was stable.
Memory usage kept growing, regardless of entity count.
Native build memory grew 2mb in a hour, which was quite okay.
Running on a tab in Google Chrome, the Wasm build of the game keeps growing in memory usage.
What you expected to happen
That the memory usage would be constant if we are not growing in entity amount.
What actually happened
We noticed a sensible but every growing memory increase in Local builds, and growing by quite a bit in the WASM builds.
Additional information
@alice-i-cecile @james7132 and @devil-ira have been given access to my game's source code to debug/possibly check.
The text was updated successfully, but these errors were encountered: