Exceeding limit of 150 wakeups per second

I’m using Unity 2020.1.10f with Xcode 12.1 on macOS Catalina.

I’ve submitted a very simple 2D game to the App Store and it’s been rejected because of a crash. In the crashlog there’s this line:

Wakeups: 45001 wakeups over the last 293 seconds (154 wakeups per second average), exceeding limit of 150 wakeups per second over 300 seconds

which is something to do with threads, apparently.

I’ve searched for this but can’t find much beyond a thread about a “hiccup” in iOS 8 from 2015. It’s not mentioned in the Troubleshooting on iOS Devices page.

Any help with this would be much appreciated.

More data from crashlog:

Heaviest stack for the target process:
9 ??? (libsystem_pthread.dylib + 7336) [0x1ece11ca8]
5 ??? ( + 4417644) [0x100c9686c]
4 ??? ( + 3820844) [0x100c04d2c]
3 ??? ( + 3823864) [0x100c058f8]
2 ??? ( + 3823348) [0x100c056f4]
1 ??? ( + 4416656) [0x100c96490]

Stack trace:

  9   ??? (libsystem_pthread.dylib + 7336) [0x1ece11ca8]
    5   Thread::RunThreadWrapper + 75 (UnityFramework + 4417644) [0x100c9686c]
      4   JobQueue::WorkLoop + 63 (UnityFramework + 3820844) [0x100c04d2c]
        3   JobQueue::processJobs + 207 (UnityFramework + 3823864) [0x100c058f8]
          2   JobQueue::ExecuteJobFromQueue + 35 (UnityFramework + 3823348) [0x100c056f4]
            1   AtomicQueue::smile:equeue + 40 (UnityFramework + 4416656) [0x100c96490]
            1   AtomicQueue::smile:equeue + 24 (UnityFramework + 4416640) [0x100c96480]
          1   JobQueue::ExecuteJobFromQueue + 103 (UnityFramework + 3823416) [0x100c05738]
            1   JobQueue::Steal + 367 (UnityFramework + 3823176) [0x100c05648]
              1   JobQueue::Exec + 203 (UnityFramework + 3822604) [0x100c0540c]
                1   AtomicStack::push + 24 (UnityFramework + 4416216) [0x100c962d8]
        1   JobQueue::processJobs + 371 (UnityFramework + 3824028) [0x100c0599c]
          1   UnityClassic::Baselib_SystemSemaphore_Acquire + 27 (UnityFramework + 8129004) [0x1010209ec]
            1   ??? (libdispatch.dylib + 18096) [0x1a4b216b0]
              1   ??? (libsystem_kernel.dylib + 15884) [0x1d1060e0c]
                1   <Kernel mode>
      1   GfxDeviceWorker::RunGfxDeviceWorker + 11 (UnityFramework + 6830720) [0x100ee3a80]
        1   GfxDeviceWorker::RunExt + 91 (UnityFramework + 6861368) [0x100eeb238]
          1   GfxDeviceWorkerAutoreleasePoolProxy + 67 (UnityFramework + 7252632) [0x100f4aa98]
            1   GfxDeviceWorker::RunCommand + 111 (UnityFramework + 6831748) [0x100ee3e84]
              1   ThreadedStreamBuffer::HandleOutOfBufferToReadFrom (ThreadedStreamBuffer.cpp:268) (ThreadedStreamBuffer.cpp:268 in UnityFramework + 4423608) [0x100c97fb8]
    3   FMOD::Thread::callback + 227 (UnityFramework + 11390356) [0x10133cd94]
      3   FMOD_OS_Time_Sleep + 19 (UnityFramework + 11276280) [0x101320ff8]
        3   ??? (libsystem_c.dylib + 472716) [0x1ae05768c]
          3   ??? (libsystem_kernel.dylib + 163120) [0x1d1084d30]
            3   <Kernel mode>
    1   ??? (libEmbeddedSystemAUs.dylib + 610136) [0x1d5168f58]
      1   ??? (libAudioToolboxUtility.dylib + 71476) [0x1b9763734]
        1   ??? (libAudioToolboxUtility.dylib + 70420) [0x1b9763314]
          1   ??? (libEmbeddedSystemAUs.dylib + 943416) [0x1d51ba538]
            1   ??? (libEmbeddedSystemAUs.dylib + 651284) [0x1d5173014]
              1   ??? (libEmbeddedSystemAUs.dylib + 712308) [0x1d5181e74]
                1   ??? (libEmbeddedSystemAUs.dylib + 611580) [0x1d51694fc]
                  1   ??? (libEmbeddedSystemAUs.dylib + 57096) [0x1d50e1f08]
                    1   ??? (AudioToolboxCore + 936232) [0x1b4d3f928]
                      1   ??? (AudioToolboxCore + 170792) [0x1b4c84b28]
                        1   ??? (AudioToolboxCore + 285444) [0x1b4ca0b04]
                          1   ??? (AudioToolboxCore + 170792) [0x1b4c84b28]
                            1   ??? (AudioToolboxCore + 139772) [0x1b4c7d1fc]
                              1   ??? (AudioToolboxCore + 1554628) [0x1b4dd68c4]
                                1   ??? (AudioToolboxCore + 1092452) [0x1b4d65b64]
                                  1   ??? (AudioToolboxCore + 1089744) [0x1b4d650d0]
                                    1   ??? (AudioToolboxCore + 6744) [0x1b4c5ca58]
  5   ??? (libdyld.dylib + 3648) [0x1a4b5fe40]
    5   main (main.mm:26 in cheesetimestables + 32284) [0x10064be1c]
      5   -[UnityFramework runUIApplicationMainWithArgc:argv:] (main.mm:96 in UnityFramework + 95328) [0x100877460]
        5   ??? (UIKitCore + 12077120) [0x1a784a840]
          5   ??? (UIKitCore + 12054884) [0x1a7845164]
            5   ??? (GraphicsServices + 14368) [0x1bb9aa820]
              5   ??? (CoreFoundation + 619708) [0x1a4e984bc]
                2   ??? (CoreFoundation + 623392) [0x1a4e99320]
                  2   ??? (CoreFoundation + 648256) [0x1a4e9f440]
                    2   ??? (CoreFoundation + 651416) [0x1a4ea0098]
                      1   ??? (libsystem_pthread.dylib + 30820) [0x1ece17864]
                        1   <Effective Thread QoS User Interactive, Requested Thread QoS User Interactive>
                      1   ??? (CoreFoundation + 503012) [0x1a4e7bce4]
                        1   ??? (QuartzCore + 963140) [0x1a8211244]
                          1   ??? (QuartzCore + 83784) [0x1a813a748]
                            1   -[UnityAppController repaintDisplayLink] (UnityAppController+Rendering.mm:71) (UnityAppController+Rendering.mm:71 in UnityFramework + 96688) [0x1008779b0]
                              1   UnityRepaint (UnityAppController+Rendering.mm:281 in UnityFramework + 96980) [0x100877ad4]
                                1   UnityPlayerLoopImpl + 239 (UnityFramework + 7452412) [0x100f7b6fc]
                                  1   PlayerLoop + 343 (UnityFramework + 3903044) [0x100c18e44]
                                    1   ExecutePlayerLoop + 139 (UnityFramework + 3902444) [0x100c18bec]
                                      1   ExecutePlayerLoop + 87 (UnityFramework + 3902392) [0x100c18bb8]
                                        1   ParticleSystem::BeginUpdateAll + 27 (UnityFramework + 1507824) [0x1009d01f0]
                                          1   ParticleSystem::BeginUpdate + 300 (UnityFramework + 1552212) [0x1009daf54]
                                            1   <Effective Thread QoS User Interactive, Requested Thread QoS User Interactive>
                2   ??? (CoreFoundation + 622560) [0x1a4e98fe0]
                  1   ??? (libobjc.A.dylib + 23056) [0x1b900ba10]
                    1   <Effective Thread QoS User Interactive, Requested Thread QoS User Interactive>
                  1   ??? (CoreFoundation + 620632) [0x1a4e98858]
                    1   ??? (CoreFoundation + 644164) [0x1a4e9e444]
                      1   ??? (UIKitCore + 12067004) [0x1a78480bc]
                        1   ??? (libAudioDSP.dylib + 4585292) [0x1ceb7374c]
                          1   <Effective Thread QoS User Interactive, Requested Thread QoS User Interactive>
                1   ??? (CoreFoundation + 622248) [0x1a4e98ea8]
                  1   ??? (CoreFoundation + 646392) [0x1a4e9ecf8]
                    1   ??? (libsystem_kernel.dylib + 15824) [0x1d1060dd0]
                      1   <Kernel mode, Effective Thread QoS User Interactive, Requested Thread QoS User Interactive>
  1   ??? (libsystem_pthread.dylib + 42868) [0x1ece1a774]
    1   <Kernel mode, Effective Thread QoS User Interactive, Requested Thread QoS User Interactive>

Update:

I didn’t know what was causing this, but optimizing seemed like a good idea. I made two major changes:

  • I switched to the new Input System and instead of checking for IsKeyDown on 23 keys every frame, I used a combination of Keyboard.current.onTextInput to read numbers and a couple of Actions for Submit and Delete
  • I added Pool Manager to pool GameObjects instead of instantiating and destroying them all over the place

I also halved the number of particles-per-second from an emitter.

Hard to say which one made the difference, because I couldn’t reproduce the crash on my testing devices.

1 Like