Canvas overload cpu - Xcode 13

Hello,

canvas uses my cpu (kernal_task 100 %) on iMac 2017 too much and can not display preview of some of my views. On my MacBook Pro everting is running well.

Are there some solutions for this?

Like setup new my iMac2017 ...etc.

Thanks for help!

Replies

Hi,

Sorry to hear you are having problems getting previews working. Best next step will be to file a feedback with diagnostics. We will need the diagnostics Xcode Previews generates in order to make sure we understand the issues the previews system is encountering. The best way to get to produce a diagnostic is to introduce an error in your view's code:

  1. When you get an error in Xcode Previews, an error banner appears in the canvas
  2. Click the "Diagnostics" button in that banner
  3. In the sheet that appears, click "Generate Report" in the bottom left of the sheet
  4. Attach (or make from the folder) the resulting zip file to the bug (will be named something like previews-diagnostics-0123456789.zip)

It showing: TimeoutError: Timed out waiting for a thunk to build after 30.0 seconds. At all, problems start with the update to Xcode 13. In some views I needed to move some brackets } up or down to make the views working witch worked perfectly with Xcode 12. In simulator the app is running well too.

The created "zip file" can't be attached somehow. Are there other ways to send it?

Add a Comment

I send the files through the asked feedback assistant (same headline).

I tried those steps to investigate the problem father.

Deinstall and reinstall Xcode 13.0 - canvas does not work proper. Install latest update of iOS and Xcode - 13.1 - canvas does not work proper. Install Xcode 12.5 - canvas does work with the affected view like before.

In Xcode 13.0 - CPU was highly used by kernel task. In Xcode 13.1 - CPU was highly used by swift frontend and RAM (64GB) is completely overloaded till the system stuck.

  • thanks! I've found the feedback and passed it along to the right engineering team for triaging

Add a Comment

After reprogramming my view, which didn't work, I was able to simulate it in canvas. There was some changes in the SwiftUI - methods like in toggle and Picker view (by the way, this wasn't described in the developer documentation). The problem is, that now I needed to implement an .on tap gesture{} to my toggle? With the picker they changed the default picker style. But still, with a cleaned up code my cpu usage still runs crazy and canvas continuously load data to my ram, till Xcode stuck and I need to restart my pc. Swift-frontend and kernel task uses of all capacities of my Mac Book Pro 2020 since updating Xcode to Version 13 and updating macOS to Monterey.

Why Xcode was running canvas before so smooth? Are you already discovered a problem and will solve this soon?

I think also other developer run in to the same problem.

  • yes, that second issue sounds like a dupe of a known issue. Sorry for any inconvenience caused!

  • I downloaded Xcode 13.2.beta and it seems like swift frontend don’t create this problem anymore.

Add a Comment