NordicSemiconductor / pc-nrfconnect-ppk

Power Profiler app for nRF Connect for Desktop

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Renderer process uses a lot of CPU

jonas-schievink opened this issue · comments

As soon as I connect to a PPK, the renderer process starts using an unreasonable amount of CPU (around 125%). Disconnecting from the PPK again immediately fixes this, so it doesn't seem to be related to any actual rendering.

This is on version 2.2.0 of the PPK software, running on Arch Linux.

This is most probably due to the JLink connection. I have seen other issues with JLink on Linux, and the PPK uses it extensively for communication. Is there any difference when you press "Start" or "Stop", instead of changing connection state?

Is there any difference when you press "Start" or "Stop", instead of changing connection state?

No, not really.

Do you poll the target state in a loop without any delay? I know the JLinkGDBServer polls it fairly frequently (and also uses too much CPU for what it does, but that's another issue).

We're using SEGGER RTT read, which I don't know how's implemented on the lower level. All I know is that we continuously poll for incoming RTT data, so that might cause some issues. What specs do you run on?

I'm on a Carbon X1 with an i7-8565U @ 1.80GHz

I think RTT needs to continuously poll some target memory locations, but that shouldn't require busy-looping like that.

Is this still an issue?

Yes. Spawned J-Link process still uses a lot of CPU time. In my case 20-30 % on i7-8550U.
Pressing "stop" does stop RTT traffic according to "J-Link - Web control panel", but CPU usage remains high.

Can you try with the latest release?

With the new version (3.0.3), CPU use does decrease to almost 0% when not sampling, which is an improvement.
While sampling using ppk1 it goes up to ~17% on my CPU according to the Task manager. This is perfectly fine as far as I'm concerned.

Here's Process Explorer screenshot with more details in case anyone is interested (PE shows lower CPU usage for some reason):
image

Thank you for the update. I will close this, and feel free to add new issues if any.