question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

High CPU usage on Raspberry Pi

See original GitHub issue

Describe the bug

A skeleton project (just the default project created by the VS extension, with a blank window) takes about 30% CPU usage on a Raspberry Pi 4.

Tested on net5.0 and netcoreapp3.1, Avalonia version 0.10.0 (the myget versions are failing to restore due to version mismatches).

I’ve attached a trace captured with dotnet trace which can be opened with PerfView here: trace.zip. A couple of screenshots below:

image

image

… it seems to be spending all of its time in unmanaged code, which dotnet trace isn’t particularly good at picking up!

strace shows a lot of activity, a good chunk of it cacheflush calls. I’ve attached the first 1s of strace output here: strace.txt.

To Reproduce Steps to reproduce the behavior:

  1. Use VS to create a new empty Avalonia project.
  2. Run this on a Rapsberry Pi 4
  3. Observe CPU usage

Desktop (please complete the following information):

  • OS: Raspbian 10
  • Version: 0.10.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
kekekekscommented, Apr 16, 2021

Unmanaged code from dispatcher run loop is epoll_wait (basically sleep). Unmanaged code from SleepLoopRenderTimer is Thread.Sleep I wonder why it spends so much time finalizing SkiaSharp’s objects since we are disposing most of them except images

0reactions
canton7commented, Mar 9, 2022

Oh! Having said that, a few deploys later and the CPU is down into the low single digits. I figure this is solved, thanks all!

Read more comments on GitHub >

github_iconTop Results From Across the Web

High CPU Usage - Raspberry Pi Forums
I went on Reddit on Pi and it just reached 89% CPU Usage. This is why it was lagging, I thought it was...
Read more >
99% CPU usage? Avoid disaster by monitoring ...
All of this means that a constant really high CPU usage could shorten the life span of the Pi and will definitely mean...
Read more >
Raspberry Pi CPU Usage Monitoring
Two programs are primarily used to monitor the CPU usage on Raspberry Pi; through Htop and through Conky extension. Both utilities are especially...
Read more >
Constant high CPU usage on Raspberry Pi 4
I've noticed that the zerotier-one service on my Raspberry Pi 4 is consuming a full CPU core. If I restart the server, it'll...
Read more >
Is it bad for the Raspberry Pi to be in 100% CPU usage ...
From the 2B onwards Raspberry Pi's have been quad core (apart from the Zero), so 100% CPU (as measured by top) would mean...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found