Are constant memory allocations normal?

Brain seems to allocate around 1.5k every single frame.

Is this to be expected or do I have some kind of strange bug ?

Cinemachine 2.8.0

Definitely not normal behaviour, at least not from my experience

You sure? Happens in late update, can you check profiler?

Alright, so I double checked empty project.

This is empty project. CM 2.8.0

Problem starts happening depending on look and follow/body aim.


With default settings but lookat and follow assigned, I get 2.6kb per frame every frame.


With LookAt cleared and aim composer not doing anything I get 1.2k with 3rd person follow.


“Do nothing” for both body and aim, but no LookAt assigned 1.2kb


Same “do nothing” but I removed the follow - now finally we have 0kb alloc.

alright, so I dug a little deeper…

this isn’t a cinemachine bug its a core unity bug.


GetComponent<> will allocate on abstract or interface… wtf.

7615939--946570--Unity_4S2Y7IlKb4.png

Are you kidding me?? How tf did this get past QA?! Lol

Actually it is a Cinemachine bug. Don’t know how that one got out into the field :hushed:, we will fix right away.
Thanks for letting us know <3

UPDATE: turns out we had already caught and fixed this. Just update your CM version to 2.8.2.

2 Likes

There is an underlying issue underneath that though. The Null Component Error message is not allocated underneath an AvailabilityEditor, aka EditorOnly flagged ProfilerMarker. That is a regression in how well the Profiler is able to hide the allocation that is meaningless to optimize if your only concern is to get your player’s game loop GC free.