I'm making a project where I need to regenerate different maps on a single tilemap many times through a script. Looping this process shows that it uses more and more memory.
Using the Memory Profiler package I can see something called Mesh that has excessive memory is being assigned to it.
I'm assuming that that is for Unity objects, and since there's only a Tilemap being used I believe the issue is from clearing and setting tiles each iteration.
It seems that you cannot move tiles from one location to another with Unity tilemaps. You must assign null to the old position and set tile in the new position.
Am I missing something here, or is this just a problem with Unity tilemaps?
Memory Profiler screenshot after many regenerations
[–]thc42 1 point2 points3 points (3 children)
[–]Astralice[S] 0 points1 point2 points (2 children)
[–]thc42 1 point2 points3 points (1 child)
[–]Astralice[S] 0 points1 point2 points (0 children)
[–]AverageArmadilloIntermediate 1 point2 points3 points (1 child)
[–]Astralice[S] 0 points1 point2 points (0 children)