Profiler issues on Android

I’m profiling our mobile game at the minute, and I’m having a few issues that are making it really hard to get any meaningful result out of it.

I’m testing on an Android device, and running Unity 5.5.1p4

1) Massive lag between an event and when it’s shown
There’s a huge lag between when something occurs on the device and when it shows up in the profiler window - anywhere between 10 - 20s. Sometimes the profiler graph just won’t update at all for ages, then start going again, though at that point, it’s hard to profile what I’m trying to profile as I don’t know if a particular spike is the result of a level load, or a script issue until I stop the recording and check it out. Enabling/disabling Deep Profile doesn’t seem to affect the issue. Only the CPU Usage view is show.

2) Stopping and starting recording
If I click on the Record button to stop recording, then later click on it again to resume, there’s a huge lag. Most of the time, it does nothing, and I either have to restart Unity, or restart the app.

3) Killing the app spams the Unity console
If I kill the app from memory, while recording or not, the console gets spammed with messages “Sending message header failed”. Sometimes if I restart the app on the phone, it will stop and I can keep profiling. Most of the time I need to restart Unity.

All of this combines to make profiling very tedious and hard to actually make worth while. Anyone had similar problems? Can anyone on the Unity side chime in? I can provide debug builds.

I’ve used the profiler before, for the same game, though on a previous Unity version, and it was never like this.

Thanks

I cant use it either, I figured it was data transfer rate, that there is huge bottleneck in transferring such huge amounts of data through USB 2.0 (both game & profile data) was just not going to work…UNLESS your project was running at 80-100 fps at its base (profile a game running @ 30 fps, you end up at 5-10). It was a least usable in the 4.X series! I think 5.0 overhead might have changed a little.

I use gut instinct now!!

p-

1 Like

I was able to use it when we first moved to Unity 5, as when we made the upgrade, I remember there was a massive difference in how shaders and plugins etc were handled, so that kicked off the first round of profiling (this was around January of last year)

It hasn’t worked for me on any Unity 5.5 release or 5.6 beta. 5.4 works great. I can create the smallest possible test project and profile with no trouble on 5.4. Same project in 5.5 - nothing.

Hi @richard_bates ,

When you say you’re getting nothing, do you mean you’re unable to profile at all, or it’s unusable because of lag issues?

Doing further testing, I found that having a standalone player (not setup for profiling) was causing a big drop in perf. Our game is multiplayer, so I was using small standalone (300x500) to test the second player. Killing that to test with another device helped a little, but it’s still pretty bad. Setup in question:

  • Android device running a build set up for profiling (normal, not deep)
  • Unity open for access to the profiler window, but not playing anything
  • Standalone (Mac) player to act as a second player, not set up for profiling (was built before any of this was tried)

Sometimes I’ll just start the Android player, and leave it on a reasonably static screen. The profiler will gather data for a few seconds, then start having huge pauses

Just made an iOS build. Doesn’t seem to have the same lag as Android, so as least I can use it, but after a while, it craps out with the line:

(Filename: /Users/builduser/buildslave/unity/build/Runtime/Network/PlayerCommunicator/GeneralConnection.cpp Line: 340)

Skipping profile frame. Receiver can not keep up with the amount of data sent

I’m guessing that’s what’s happening with Android? Too much data, profiler falls over, and seeing as it doesn’t seem to stop even when the game is killed on the device, it all builds up

I get nothing at all. In fact, even selecting “AndroidPlayer(ADB@127.0.01:54999)” as the ActiveProfiler causes the Profiler UI to become unresponsive for a while.

Hm, sounds like you’re just not able to actually connect the profiler. You’ve selected Development Build from the Build Settings menu, right? Your device shows up when you type “adb devices” into the command line? Have you tried manually entering the IP of your device? “adb shell netcfg” will show it, then you can enter it in the Profiler window