Hello All,
While profiling my app I found out that changing Image.fillAmount property allocates 20B of memory.
It is not much but in my case when I have timer made with Image.fillAmount, this memory is allocated every frame.
Screenshot:
It is of course handled by GarbageCollector at some point but we all know how GC can decrease framerate when collecting garbage. Especially on mobile.
One of my goals is to use pooling and not give GC reason to work. I am close to achieve that but above problem exists.
Btw, do maybe anyone know what is this âNetworkIdentity.UNetStaticUpdateâ and âGetMainGameViewRenderRectâ?
Sorry for the thread hi-jack but the standard âfile a bugâ response really gets my goat because our game has become all but unplayable since upgrading to unity 5. When I did take the time to create a reduced test case for the multiple megabyte allocations and multiple second stalls we see when presenting simple relatively simple bits of UI it was resolved as âby designâ - Iâm not completely naive and I apprectiate that things do cost CPU time and memory but there are some serious issues with the UI in 5.x - Iâm all for trying to get to the bottom of them together but itâs not helpful to effectively be told that opening a UI should take multiple seconds and allocate about 5 megs - that its just ridiculous.
So good luck with that bug report for allocating 20 bytesâŚ
PM me some of the bug numbers (if you still have them) and iâll take another look to see why they were closed by design and maybe be able to give you more details.
I can confirm that fillAmount does generate allocation, its not a bug. I guess it uses some type of array.
There is nothing to report, just open Unity (if not a problem) and change fillAmount in update or lateupdate and it will allocate memory. Even doing fillAmount = 0 will allocate
UI.Image.fillAmount setter generates unnecessary garbage when setting any value since it calls Single.Equals() from SetPropertyUtility.SetStruct() method. So making any kind of progress bars using Image with constantly modified fillAmount is producing a lot of garbage. I believe this can be fixed easily and will help a lot to avoid GC spikes on mobile platforms.