UI Garbage Collection

So i recently started optimizing my game by reducing the number of Garbage Collector calls and I noticed, that set the UI elements to parent will trigger a GC call.

As can be seen in the attached picture that every time I set the parent of an UI element, the GC allocs 8.7kb. I don’t know if it intended or it is a bug, but if I have many UI elements and manipulate their properties over time I will get a huge amount of GC calls.

2611242--183076--ui_dc.jpeg

Can you post all the code concern by this please? (UIMiniMapPanel.SpawnItem() function)

I use SetParent with UI elements in my code too and this is not as much GC expensive as yours.