bevy_tilemap icon indicating copy to clipboard operation
bevy_tilemap copied to clipboard

memory leak when updating tiles?

Open kyunghoon opened this issue 2 years ago • 3 comments

Bevy Tilemap version 0.4

Operating system & version MacOS 11.3

What you did tried to update tiles using Tilemap.get_tile_mut(..)

What you expected to happen expected the memory usage to remain flat (~80 MB)

What actually happened memory usage slowly grows and grows (2 GB and counting), visually looks correct.

Additional information if i comment out the single line of code that does the modification, the memory issue goes away.

kyunghoon avatar Sep 10 '21 08:09 kyunghoon

Huh, thats interesting. I hadn't noticed that on my end but clearly, it appears to keep grabbing the tile mutably ... ? Should be only updating the one memory position. Shouldn't be making copies of it without dropping it, as per how Rust typically works. Do you have a more specific use case that could possible be doing something odd?

joshuajbouw avatar Sep 13 '21 14:09 joshuajbouw

I can confirm the memory leak on tile update. Haven't found a solution yet but still looking.

joshuajbouw avatar Nov 13 '21 14:11 joshuajbouw

Turns out it is related to this: https://github.com/bevyengine/bevy/issues/2439

joshuajbouw avatar Nov 13 '21 18:11 joshuajbouw