code
code copied to clipboard
Maxing out CPU for some reason
For some reason, my CPU is being absolutely devoured by code; on htop it shows as io.elementary.code one time and as /bin/bash usr/bin/dmenu_recency the next The system and CPU run just fine when code's closed
I reinstalled it via pamac, no dice Any ideas what's going on
On manjaro
Try closing all documents and project folders and turn off all extensions. If that stops the CPU use then try reopening the project (if any) then each document then each extension, noting at each point whether the CPU usage spikes. If Code still consumes a lot of CPU even with no projects, documents or extensions open then there must be a deeper incompatibility with the system. Code is developed and tested on elementaryos so experiences on other OSes may vary. In future, Code may be supplied Flatpak'd which will help it run on a wider range of platforms.
Hey Jeremy thanks for your prompt reply. Yeah it's consuming a lot of CPU with no projects and gets worse with each project opened. I've been using it for a year and it was working fine just yesterday; all I did since was install/remove a bunch of seeming irrelevant applications via pamac as I was trying to get a screen recorder working; I was having trouble capturing the audio but it turned out to be a super simple fix) In the pamac log the only things removed were new things just installed so it doesn't make sense to me that code would be affected Anyways, right after I was done messing around with that I noticed code started lagging like bonkers
Also, how are code/dmenu_recency related, as I noticed it's always one OR the other is hogging the CPU (open code once, dmenu is hogging, close and reopen, io.elementary.code is the offender, close and reopen, etc.)
As far as I can see dmenu_recency does not exist in elementaryos - at least not in /usr/bin
. Not sure what it does - seems to be a manjaro thing. I'll look into it later.
Seems that process is related to DMenu
- see https://wiki.manjaro.org/index.php/DMenu. Did you launch Code using DMenu?
Try launching Code from a Terminal commandline just by typing io.elementary.code
(after killing any existing Code processes) to see whether it makes a difference.
Which desktop environment are you running Manjaro with? Code is designed to work with Gnome only.
CPU issue happens regardless of using dmenu launcher or opening by terminal or opening by clicking on text document
Using i3wm and code has been flawless and going strong for more than a year
Is there a method where we can dissect whats going on with the program while this CPU issue is occuring, diagnose it in realtiime as it were
Did you install it from source? You could try bisecting it by commit if you know when it last worked for you.
There are tools available (e.g. valgrind) for measuring how long a running program spends running each function but I am not familiar with their use.
I usually use gdb but that is best used when the program actually crashes. You should be able to find websites teaching how to use it for e.g. diagnosing infinite loops as well.
Are you getting Code from a stable repository or the daily one? The daily repository recently merged a commit forcing the use of portals (GTK_USE_PORTAL=1) which I guess could have unforeseen consequences on other systems.
If there are no open projects documents or extensions there is nothing for Code to do after it has checked the settings and constructed the interface (on my system CPU consumption is 0%).
Installed from AUR; portals were touched wrt. one of the screenshare apps so maybe there's something there I removed the app that was using portals and maybe the portals with it
> systemctl --user status xdg-desktop-portal
Unit xdg-desktop-portal.service could not be found.
> systemctl --user status pipewire.socket pipewire
Unit pipewire.socket could not be found.
Unit pipewire.service could not be found.
> systemctl --user status pipewire-media-session
Unit pipewire-media-session.service could not be found.
> systemctl --user status xdg-desktop-portal-gtk
Unit xdg-desktop-portal-gtk.service could not be found.
Is it possible to reinstall the portals separately? - I do not know anything about Manjaro.
Closing as there are no reports of it occurring recently and not on elementary Horus. Please reopen if there is still unreasonable CPU consumption under some circumstances.