You are not logged in.

#1 2024-01-23 16:07:59

chang-zhao
Member
Registered: 2024-01-21
Posts: 28

[SOLVED] Many processes (PID constantly grows)

If I run "ps -e" I see that latest processes PIDs increase much every time.

Compare the left half and the right half (about 10 minutes later):

   4727 ?        00:00:01 wineserver		5431 ?        00:00:01 Privileged Cont	
   4733 ?        00:00:00 services.exe          5472 ?        00:00:07 WebExtensions
   4736 ?        00:00:00 winedevice.exe        5616 ?        00:00:00 Utility Process
   4745 ?        00:00:07 winedevice.exe        5627 ?        00:00:02 Isolated Web Co
   4754 ?        00:00:00 plugplay.exe          5638 ?        00:00:09 Isolated Web Co
   4756 ?        00:00:00 explorer.exe          5732 ?        00:00:01 Isolated Web Co
   4764 ?        00:00:00 svchost.exe           5777 ?        00:00:00 kworker/2:1-events
   4775 ?        00:00:00 rpcss.exe             5794 ?        00:00:01 xfce4-terminal
   5155 ?        00:00:00 kworker/u64:2-events_unbound 5825 pts/0 00:00:00 bash
   5349 ?        00:00:08 firefox               6176 ?        00:00:01 Isolated Web Co
   5407 ?        00:00:00 Socket Process        6411 ?        00:00:06 Isolated Web Co
   5420 ?        00:00:00 kworker/3:0-events    6464 ?        00:00:00 kworker/2:0-events
   5431 ?        00:00:00 Privileged Cont       6465 ?        00:00:00 kworker/0:1
   5472 ?        00:00:02 WebExtensions         6544 ?        00:00:03 geany
   5616 ?        00:00:00 Utility Process       6608 pts/1    00:00:00 bash
   5627 ?        00:00:02 Isolated Web Co       6885 ?        00:00:00 Isolated Web Co
   5638 ?        00:00:00 Web Content           6943 ?        00:00:00 kworker/1:1
   5648 ?        00:00:00 Web Content           6944 ?        00:00:00 RDD Process
   5732 ?        00:00:00 Web Content           6990 ?        00:00:00 Isolated Web Co
   5777 ?        00:00:00 kworker/2:1           6994 ?        00:00:00 Web Content
   5794 ?        00:00:00 xfce4-terminal        7063 ?        00:00:00 kworker/3:2
   5798 ?        00:00:00 xfconfd               7064 ?        00:00:00 Web Content
   5825 pts/0    00:00:00 bash                  7068 ?        00:00:00 Web Content
   5994 pts/0    00:00:00 ps                    7148 pts/0    00:00:00 ps

The rate of growing PIDs is at least 2-3 processes per second, it seems more when I switch between windows.

I am not a tech savvy guy so I have no idea how to debug it. Advice?

The only similar thing happened when some plugin of XFCE panel crashed and then restarted automatically. I'm not sure if this is the case here.

journalctl -b shows just a few errors at startup, like:

Jan 23 15:01:40 arch kernel: ACPI: Added _OSI(Processor Aggregator Device)
Jan 23 15:01:40 arch kernel: ACPI BIOS Error (bug): Failure creating named object [\_SB.PCI0.GPP0.VGA], AE_ALRE>
Jan 23 15:01:40 arch kernel: ACPI Error: AE_ALREADY_EXISTS, During name lookup/catalog (20230628/psobject-220)
Jan 23 15:01:40 arch kernel: ACPI: Skipping parse of AML opcode: Device (0x5B82)
Jan 23 15:01:40 arch kernel: ACPI BIOS Error (bug): Failure creating named object [\_SB.PCI0.GPP0.HDAU], AE_ALR>
Jan 23 15:01:40 arch kernel: ACPI Error: AE_ALREADY_EXISTS, During name lookup/catalog (20230628/psobject-220)
Jan 23 15:01:40 arch kernel: ACPI: Skipping parse of AML opcode: Device (0x5B82)

(...skip...)

Jan 23 15:01:45 arch systemd[586]: Created slice User Core Session Slice.
Jan 23 15:01:45 arch systemd[586]: Starting D-Bus User Message Bus...
Jan 23 15:01:45 arch dbus-broker-launch[614]: Service file '/usr/local/share/dbus-1/services/org.xfce.Thunar.FileManager1.service' is not named after the D-Bus name 'org.freedesktop.FileManager1'.
Jan 23 15:01:45 arch dbus-broker-launch[614]: Service file '/usr/local/share/dbus-1/services/org.xfce.Tumbler.Cache1.service' is not named after the D-Bus name 'org.freedesktop.thumbnails.Cache1'.
Jan 23 15:01:45 arch dbus-broker-launch[614]: Service file '/usr/local/share/dbus-1/services/org.xfce.Tumbler.Manager1.service' is not named after the D-Bus name 'org.freedesktop.thumbnails.Manager1'.
Jan 23 15:01:45 arch dbus-broker-launch[614]: Service file '/usr/local/share/dbus-1/services/org.xfce.Tumbler.Thumbnailer1.service' is not named after the D-Bus name 'org.freedesktop.thumbnails.Thumbnailer1'.
Jan 23 15:01:45 arch dbus-broker-launch[614]: Ignoring duplicate name 'org.xfce.FileManager' in service file '/usr/share/dbus-1/services/org.xfce.FileManager.service'
Jan 23 15:01:45 arch dbus-broker-launch[614]: Service file '/usr/share/dbus-1/services/org.xfce.Thunar.FileManager1.service' is not named after the D-Bus name 'org.freedesktop.FileManager1'.
Jan 23 15:01:45 arch dbus-broker-launch[614]: Ignoring duplicate name 'org.freedesktop.FileManager1' in service file '/usr/share/dbus-1/services/org.xfce.Thunar.FileManager1.service'
Jan 23 15:01:45 arch dbus-broker-launch[614]: Ignoring duplicate name 'org.xfce.Thunar' in service file '/usr/share/dbus-1/services/org.xfce.Thunar.service'
Jan 23 15:01:45 arch dbus-broker-launch[614]: Service file '/usr/share/dbus-1/services/org.xfce.Tumbler.Cache1.service' is not named after the D-Bus name 'org.freedesktop.thumbnails.Cache1'.
Jan 23 15:01:45 arch dbus-broker-launch[614]: Ignoring duplicate name 'org.freedesktop.thumbnails.Cache1' in service file '/usr/share/dbus-1/services/org.xfce.Tumbler.Cache1.service'
Jan 23 15:01:45 arch dbus-broker-launch[614]: Service file '/usr/share/dbus-1/services/org.xfce.Tumbler.Manager1.service' is not named after the D-Bus name 'org.freedesktop.thumbnails.Manager1'.
Jan 23 15:01:45 arch dbus-broker-launch[614]: Ignoring duplicate name 'org.freedesktop.thumbnails.Manager1' in service file '/usr/share/dbus-1/services/org.xfce.Tumbler.Manager1.service'
Jan 23 15:01:45 arch dbus-broker-launch[614]: Service file '/usr/share/dbus-1/services/org.xfce.Tumbler.Thumbnailer1.service' is not named after the D-Bus name 'org.freedesktop.thumbnails.Thumbnailer1'.
Jan 23 15:01:45 arch dbus-broker-launch[614]: Ignoring duplicate name 'org.freedesktop.thumbnails.Thumbnailer1' in service file '/usr/share/dbus-1/services/org.xfce.Tumbler.Thumbnailer1.service'
Jan 23 15:01:45 arch dbus-broker-launch[614]: Service file '/usr/share/dbus-1/services/org.xfce.xfce4-notifyd.Notifications.service' is not named after the D-Bus name 'org.freedesktop.Notifications'.
Jan 23 15:01:45 arch dbus-broker-launch[614]: Service file '/usr/share/dbus-1/services/org.xfce.xfce4-notifyd.Notifyd.service' is not named after the D-Bus name 'org.xfce.Notifyd'.
Jan 23 15:01:45 arch dbus-broker-launch[614]: Policy to allow eavesdropping in /usr/share/dbus-1/session.conf +31: Eavesdropping is deprecated and ignored
Jan 23 15:01:45 arch dbus-broker-launch[614]: Policy to allow eavesdropping in /usr/share/dbus-1/session.conf +33: Eavesdropping is deprecated and ignored
Jan 23 15:01:45 arch systemd[586]: Started D-Bus User Message Bus.

and some lines about rtkit-daemon:

Jan 23 15:38:47 arch rtkit-daemon[1217]: Supervising 7 threads of 4 processes of 1 users.
Jan 23 15:38:47 arch rtkit-daemon[1217]: Supervising 7 threads of 4 processes of 1 users.
Jan 23 15:38:47 arch rtkit-daemon[1217]: Supervising 7 threads of 4 processes of 1 users.
Jan 23 15:43:33 arch systemd[1]: Starting Time & Date Service...
Jan 23 15:43:33 arch systemd[1]: Started Time & Date Service.
Jan 23 15:44:00 arch systemd[1]: Starting Hostname Service...
Jan 23 15:44:01 arch dbus-broker-launch[488]: Activation request for 'org.freedesktop.Avahi' failed: The systemd unit 'dbus-org.>
Jan 23 15:44:01 arch systemd[586]: Starting User preferences database...
Jan 23 15:44:01 arch systemd[1]: Started Hostname Service.
Jan 23 15:44:01 arch systemd[586]: Started User preferences database.
Jan 23 15:44:03 arch systemd[1]: systemd-timedated.service: Deactivated successfully.
Jan 23 15:44:31 arch systemd[1]: systemd-hostnamed.service: Deactivated successfully.
Jan 23 15:44:35 arch systemd[1]: Starting Time & Date Service...
Jan 23 15:44:35 arch systemd[1]: Started Time & Date Service.
Jan 23 15:44:35 arch rtkit-daemon[1217]: Supervising 6 threads of 3 processes of 1 users.
Jan 23 15:44:35 arch rtkit-daemon[1217]: Supervising 6 threads of 3 processes of 1 users.
Jan 23 15:44:35 arch rtkit-daemon[1217]: Supervising 6 threads of 3 processes of 1 users.
Jan 23 15:44:35 arch rtkit-daemon[1217]: Supervising 6 threads of 3 processes of 1 users.
Jan 23 15:44:35 arch rtkit-daemon[1217]: Successfully made thread 7643 of process 7546 owned by '1000' RT at priority 10.
Jan 23 15:44:35 arch rtkit-daemon[1217]: Supervising 7 threads of 4 processes of 1 users.
Jan 23 15:44:35 arch rtkit-daemon[1217]: Supervising 7 threads of 4 processes of 1 users.
Jan 23 15:44:35 arch rtkit-daemon[1217]: Supervising 7 threads of 4 processes of 1 users.
Jan 23 15:44:36 arch rtkit-daemon[1217]: Supervising 7 threads of 4 processes of 1 users.
Jan 23 15:44:36 arch rtkit-daemon[1217]: Supervising 7 threads of 4 processes of 1 users.
Jan 23 15:44:36 arch rtkit-daemon[1217]: Supervising 7 threads of 4 processes of 1 users.
Jan 23 15:44:36 arch rtkit-daemon[1217]: Supervising 7 threads of 4 processes of 1 users.
Jan 23 15:44:36 arch rtkit-daemon[1217]: Supervising 7 threads of 4 processes of 1 users.
Jan 23 15:44:36 arch rtkit-daemon[1217]: Supervising 7 threads of 4 processes of 1 users.
Jan 23 15:44:37 arch rtkit-daemon[1217]: Supervising 7 threads of 4 processes of 1 users.
Jan 23 15:44:37 arch rtkit-daemon[1217]: Supervising 7 threads of 4 processes of 1 users.
Jan 23 15:45:05 arch systemd[1]: systemd-timedated.service: Deactivated successfully.
Jan 23 15:45:20 arch systemd[586]: Started dbus-:1.2-org.xfce.Xfconf@2.service.
Jan 23 15:49:31 arch rtkit-daemon[1217]: Supervising 7 threads of 4 processes of 1 users.
Jan 23 15:49:31 arch rtkit-daemon[1217]: Supervising 7 threads of 4 processes of 1 users.
Jan 23 15:49:45 arch rtkit-daemon[1217]: Supervising 7 threads of 4 processes of 1 users.
Jan 23 15:49:45 arch rtkit-daemon[1217]: Supervising 7 threads of 4 processes of 1 users.

Linux arch 6.6.13-1-lts #1 SMP PREEMPT_DYNAMIC Sat, 20 Jan 2024 14:48:01 +0000 x86_64 GNU/Linux
NVIDIA Driver Version: 545.29.06
xfce4-panel 4.18.5 (Xfce 4.18)

Thank you.

Last edited by chang-zhao (2024-01-23 20:34:25)

Offline

#2 2024-01-23 16:11:35

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,232

Re: [SOLVED] Many processes (PID constantly grows)

Debug what? Every time a new process is created for any reason it will get a new PID. In and of itself this isn't an issue. I see web contents, basically every time you open a new tab in your browser that will get a new process. Nothing about this is inherently worrisome or an issue per se.

Offline

#3 2024-01-23 16:23:50

chang-zhao
Member
Registered: 2024-01-21
Posts: 28

Re: [SOLVED] Many processes (PID constantly grows)

PS. /var/log/Xorg.0.log shows things like (I don't know what it means):

[    12.477] (--) NVIDIA(GPU-0): DFP-3: Internal TMDS
[    12.477] (--) NVIDIA(GPU-0): DFP-3: 165.0 MHz maximum pixel clock
[    12.477] (--) NVIDIA(GPU-0): 
[   845.073] (--) NVIDIA(GPU-0): BenQ BL2411 (DFP-0): connected
[   845.073] (--) NVIDIA(GPU-0): BenQ BL2411 (DFP-0): Internal TMDS
[   845.073] (--) NVIDIA(GPU-0): BenQ BL2411 (DFP-0): 330.0 MHz maximum pixel clock
[   845.073] (--) NVIDIA(GPU-0): 
[   845.073] (--) NVIDIA(GPU-0): DFP-1: disconnected
[   845.073] (--) NVIDIA(GPU-0): DFP-1: Internal TMDS
[   845.073] (--) NVIDIA(GPU-0): DFP-1: 165.0 MHz maximum pixel clock
[   845.073] (--) NVIDIA(GPU-0): 
[   845.073] (--) NVIDIA(GPU-0): DFP-2: disconnected
[   845.073] (--) NVIDIA(GPU-0): DFP-2: Internal DisplayPort
[   845.073] (--) NVIDIA(GPU-0): DFP-2: 1440.0 MHz maximum pixel clock
[   845.073] (--) NVIDIA(GPU-0): 
[   845.073] (--) NVIDIA(GPU-0): DFP-3: disconnected
[   845.073] (--) NVIDIA(GPU-0): DFP-3: Internal TMDS
[   845.073] (--) NVIDIA(GPU-0): DFP-3: 165.0 MHz maximum pixel clock
[   845.073] (--) NVIDIA(GPU-0): 
[   845.088] (--) NVIDIA(GPU-0): BenQ BL2411 (DFP-0): connected
[   845.088] (--) NVIDIA(GPU-0): BenQ BL2411 (DFP-0): Internal TMDS
[   845.088] (--) NVIDIA(GPU-0): BenQ BL2411 (DFP-0): 330.0 MHz maximum pixel clock
[   845.088] (--) NVIDIA(GPU-0): 
[   845.089] (--) NVIDIA(GPU-0): DFP-1: disconnected
[   845.089] (--) NVIDIA(GPU-0): DFP-1: Internal TMDS
[   845.089] (--) NVIDIA(GPU-0): DFP-1: 165.0 MHz maximum pixel clock
[   845.089] (--) NVIDIA(GPU-0): 
[   845.089] (--) NVIDIA(GPU-0): DFP-2: disconnected
[   845.089] (--) NVIDIA(GPU-0): DFP-2: Internal DisplayPort
[   845.089] (--) NVIDIA(GPU-0): DFP-2: 1440.0 MHz maximum pixel clock
[   845.089] (--) NVIDIA(GPU-0): 
[   845.089] (--) NVIDIA(GPU-0): DFP-3: disconnected
[   845.089] (--) NVIDIA(GPU-0): DFP-3: Internal TMDS
[   845.089] (--) NVIDIA(GPU-0): DFP-3: 165.0 MHz maximum pixel clock
[   845.089] (--) NVIDIA(GPU-0): 
[   845.181] (--) NVIDIA(GPU-0): BenQ BL2411 (DFP-0): connected
[   845.181] (--) NVIDIA(GPU-0): BenQ BL2411 (DFP-0): Internal TMDS
[   845.181] (--) NVIDIA(GPU-0): BenQ BL2411 (DFP-0): 330.0 MHz maximum pixel clock
[   845.181] (--) NVIDIA(GPU-0): 
[   845.181] (--) NVIDIA(GPU-0): DFP-1: disconnected
[   845.181] (--) NVIDIA(GPU-0): DFP-1: Internal TMDS
[   845.181] (--) NVIDIA(GPU-0): DFP-1: 165.0 MHz maximum pixel clock
[   845.181] (--) NVIDIA(GPU-0): 
[   845.181] (--) NVIDIA(GPU-0): DFP-2: disconnected
[   845.181] (--) NVIDIA(GPU-0): DFP-2: Internal DisplayPort
[   845.181] (--) NVIDIA(GPU-0): DFP-2: 1440.0 MHz maximum pixel clock
[   845.181] (--) NVIDIA(GPU-0): 
[   845.181] (--) NVIDIA(GPU-0): DFP-3: disconnected
[   845.181] (--) NVIDIA(GPU-0): DFP-3: Internal TMDS
[   845.181] (--) NVIDIA(GPU-0): DFP-3: 165.0 MHz maximum pixel clock
[   845.181] (--) NVIDIA(GPU-0): 
[   845.232] (--) NVIDIA(GPU-0): BenQ BL2411 (DFP-0): connected
[   845.232] (--) NVIDIA(GPU-0): BenQ BL2411 (DFP-0): Internal TMDS

Offline

#4 2024-01-23 16:25:39

chang-zhao
Member
Registered: 2024-01-21
Posts: 28

Re: [SOLVED] Many processes (PID constantly grows)

V1del wrote:

Debug what? Every time a new process is created for any reason it will get a new PID. In and of itself this isn't an issue. I see web contents, basically every time you open a new tab in your browser that will get a new process. Nothing about this is inherently worrisome or an issue per se.

And if I don't do anything, why do processes keep spawning?
In 20 hours of uptime I get PIDs over 200000.
The system still works, but I'd like to know what's going on...

Offline

#5 2024-01-23 16:33:32

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,642

Re: [SOLVED] Many processes (PID constantly grows)

Processes get started, they finish, they go away.  PIDs are largely monotonic; the system probably won't reuse a PID until it has to.
Suppose you have something that checks for new email once every 15 seconds.  Every 15 seconds, a new process is likely to be spawned to go handle that.  Then it is done, it goes away.  a few seconds later, the process repeats.   Same thing for stuff checking the weather, or pinging a website to see if there are updates.  Maybe  someone or something is trying to log into your system remotely, or is probing your system for open ports.   

All these things that give the illusion of lots of things happening at once could be spawning processes.  Most of them are going to be short lived.

Edit:  This system has been up for 17 hours.  The highest PID when last I checked was 461580

Last edited by ewaller (2024-01-23 16:35:20)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#6 2024-01-23 16:47:07

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,232

Re: [SOLVED] Many processes (PID constantly grows)

What concretely are you worrying about? Forget the PIDs that's not a useful metric. Maybe isolate your environment, do you see the increase when running just in a terminal? When running something other than xfce?

Offline

#7 2024-01-23 16:47:30

chang-zhao
Member
Registered: 2024-01-21
Posts: 28

Re: [SOLVED] Many processes (PID constantly grows)

ewaller wrote:

Processes get started, they finish, they go away.  PIDs are largely monotonic; the system probably won't reuse a PID until it has to.
Suppose you have something that checks for new email once every 15 seconds.  Every 15 seconds, a new process is likely to be spawned to go handle that.  Then it is done, it goes away.  a few seconds later, the process repeats.   Same thing for stuff checking the weather, or pinging a website to see if there are updates.  Maybe  someone or something is trying to log into your system remotely, or is probing your system for open ports.   

All these things that give the illusion of lots of things happening at once could be spawning processes.  Most of them are going to be short lived.

Edit:  This system has been up for 17 hours.  The highest PID when last I checked was 461580

Thank you all guys for everything you do.

I feel ashamed for stealing your time because of some nonsense.

Still, normally my PIDs went to about maybe 50000 for such period, so I'm curious.

Is there a way to record which processes start and quit?

Thank you, guys, really.

Offline

#8 2024-01-23 16:49:11

chang-zhao
Member
Registered: 2024-01-21
Posts: 28

Re: [SOLVED] Many processes (PID constantly grows)

V1del wrote:

What concretely are you worrying about? Forget the PIDs that's not a useful metric. Maybe isolate your environment, do you see the increase when running just in a terminal? When running something other than xfce?

I don't know how to "isolate your environment", I'll have to learn it.

Thank you for teaching me a bit. Cheers smile.

Offline

#9 2024-01-23 17:35:05

Ferdinand
Member
From: Norway
Registered: 2020-01-02
Posts: 338

Re: [SOLVED] Many processes (PID constantly grows)

What V1del means by isolating your environment is likely to disconnect it from the network, and any peripherals that produce input, or otherwise require handling by the computer. Also, by running just in a terminal, I assume he means to not start a desktop environment - just keep the computer as idle as possible.

The purpose would be to demonstrate that you won't have many new processes then.

I wouldn't bother, though - it's basically like ewaller stated; processes come and go, and the Process IDs will keep increasing. It is not a problem, it's just the way it is.

I write just to share a couple of links for more info if you're interested.

In Linux everything (most things at least) is treated as a file, also processes - and there's an interesting article in the wiki explaining a bit about it:
https://wiki.archlinux.org/title/Procfs

Also, although your question may seem basic, it also touches on a complex issue. Have a look at the Baeldung Linux Processes Guide - it's full of useful and interesting stuff smile
https://www.baeldung.com/linux/linux-processes-guide

I see this is your first topic, so welcome to Arch! Nice to meet you!

Edit: And also edit the topic of your first post to start with "SOLVED", so people see this thread doesn't need further answering.

Last edited by Ferdinand (2024-01-23 17:36:32)

Offline

#10 2024-01-23 20:02:20

loqs
Member
Registered: 2014-03-06
Posts: 18,928

Re: [SOLVED] Many processes (PID constantly grows)

chang-zhao wrote:

Is there a way to record which processes start and quit?

Yes for example with audit.  Be careful of flooding yourself with the generated output.

Offline

#11 2024-01-23 20:42:48

frostschutz
Member
Registered: 2013-11-15
Posts: 1,647

Re: [SOLVED] Many processes (PID constantly grows)

Sometimes pstree is enough to find the culprit.

pstree -p > pstree.a
sleep 30
pstree -p > pstree.b
diff -u pstree.a pstree.b
--- pstree.a	2024-01-23 21:40:42.981021437 +0100
+++ pstree.b	2024-01-23 21:41:12.998860211 +0100
@@ -313,7 +313,7 @@
            |-rtkit-daemon(3347)-+-{rtkit-daemon}(3348)
            |                    `-{rtkit-daemon}(3349)
            |-smartd(1572)
-           |-swaybar(1748)---swaytime.sh(1768)---sleep(20002)
+           |-swaybar(1748)---swaytime.sh(1768)---sleep(20121)
            |-swaybg(1731)
            |-swayidle(1752)
            |-systemd(1630)-+-(sd-pam)(1637)

So in my case one culprit is my swaybar status_command, which is a shell script that runs in the background all the time, just to help sway display the current date time, temperatures, music track, etc. and it uses up quite a few PIDs just to collect that information every loop (updates every 5 seconds). That's just how shell scripts work. It could be done more efficiently in a Python script or whatever, and never have to spawn a single subprocess, but why even bother, right? ;-)

Offline

#12 2024-01-23 20:47:26

chang-zhao
Member
Registered: 2024-01-21
Posts: 28

Re: [SOLVED] Many processes (PID constantly grows)

Ferdinand - and V1del, ewaller, loqs - nice to meet you too!

I'm happy to be here.

loqs, yes, I will be careful. Only about 30+ Gb free on my SSD. big_smile

Offline

#13 2024-01-23 20:56:57

chang-zhao
Member
Registered: 2024-01-21
Posts: 28

Re: [SOLVED] Many processes (PID constantly grows)

frostschutz wrote:

Sometimes pstree is enough to find the culprit.

pstree -p > pstree.a
sleep 30
pstree -p > pstree.b
diff -u pstree.a pstree.b
--- pstree.a	2024-01-23 21:40:42.981021437 +0100
+++ pstree.b	2024-01-23 21:41:12.998860211 +0100
@@ -313,7 +313,7 @@
            |-rtkit-daemon(3347)-+-{rtkit-daemon}(3348)
            |                    `-{rtkit-daemon}(3349)
            |-smartd(1572)
-           |-swaybar(1748)---swaytime.sh(1768)---sleep(20002)
+           |-swaybar(1748)---swaytime.sh(1768)---sleep(20121)
            |-swaybg(1731)
            |-swayidle(1752)
            |-systemd(1630)-+-(sd-pam)(1637)

So in my case one culprit is my swaybar status_command, which is a shell script that runs in the background all the time, just to help sway display the current date time, temperatures, music track, etc. and it uses up quite a few PIDs just to collect that information every loop (updates every 5 seconds). That's just how shell scripts work. It could be done more efficiently in a Python script or whatever, and never have to spawn a single subprocess, but why even bother, right? ;-)

Thank you, frostschutz!
Indeed, a helpful view, that I'm going to study a bit now.
Have a good day (night too)!

Offline

Board footer

Powered by FluxBB