What is "Controller.SendData" and why is it allocating so much garbage?

I’m trying to track down a periodic dramatic hitch in our framerate. I caught an instance of it while deep profiling, and the culprit seems to be Controller.SendData():

…or, possibly, it’s garbage collection, but Controller.SendData seems largely responsible for that too.

But we don’t have any such class in our code. Nor can I find anything about it in the Unity reference, though maybe it’s an internal class. It’s even possible that it’s part of the profiler connection, and I’m chasing a red herring. Anybody know what this is, or a way to find out?

Found it! It’s part of Mixpanel. Looks like Mixpanel is allocating many MB of garbage whenever it kicks in.

Is that part of Unity? Or did you install that?

It’s installed via the PackageManager.

Let me rephrase my question.

Is Mixpanel a core part of Unity that I would likely install by default in a new project?

Or is it a specific package that you said “I want Mixpanel!” and included it via PM?

It’s not a core part of Unity, and it’s not something I would choose (probably ever). This is a team project, and somebody else installed it at the behest of the director.

1 Like