"autostart" in the program list using increasingly RAM

I am using the automatic suspend option with Manjaro KDE and noticed recently that there is a program shown in the Systemmonitor programms list which occupies an increasing amount of RAM and almost continuously uses CPU power (around 1-2%). Further, it accesses the internet now and then, uploading and downloading some stuff (only a few kB), and reads from and writes to the disk. It continues to consume an increasing amount of RAM, though it does that slowly (but while I am writing this, it has added about 400 MB RAM to the total which is now 13.3 GB).
I first thought this autostart has to do with my autostart.sh skript and was wondering how it could still be running, because it comes to an end every time after I started it. Now I suspect it could either have to do with the suspend mode, or something strange is going on.
I doubt it has to do with the suspend mode, because at least in my logic, if a program is needed to wake up the PC, it would terminate by itself once it has fulfilled its purpose. Or at least it would be dormant itself, until the next suspension occurs, and not access Internet and hard disk every few seconds.
I was also surprised to see that this programme does not appear in the processes list. However, When I want to terminate it, it tells me that around 90 processes will be terminated.
Can anyone help me to understand this?
One more info that may be helpful: In the autostart in system settings there are 5 programs listed that are running: CopyQ, Insync, KAlarm, matray, Nextcloud. Does that amount to >90 processes?

ā€¦ and what program / process would that be?

I would imagine that Insync and matray would occasionally use the internet - itā€™s how they work, I guess ā€¦

Hi @DrMartinus,

To me it sound like either

  • Your suspend isnā€™t working properly; or
  • The program you mention is kind of dodgy, or has a memory leak. Itā€™s activity might even inhibit the suspend.

As far as I know, this is done by the kernel itself, although it can be prevented by a ā€œnormalā€ program.

Check the logs for any errors, and the output here for us to take a look:

journalctl --boot=-1 --unit=systemd-suspend --no-pager

Also check the servicesā€™ status:

systemctl status systemd-suspend

Also errors from you current boot might give you a clue:

journalctl --priority=warning..crit --no-pager --boot=-1

Where:

  • The --priority=warning..err argument limits the output to warnings and errors only;
  • --no-pager formats the output nicely for use here, on the forum;
  • the --boot=0 argument limits the messages to be from the current boot; and
  • the --unit=systemd-suspend limits the messages to be only from the attempts to suspend the computer.

P.S.:

That sounds excessive and a bit dodgy. Everything on my PC consumes less than that:

$ free --human
               total        used        free      shared  buff/cache   available
Mem:            15Gi       8.8Gi       2.7Gi       134Mi       4.5Gi       6.8Gi
Swap:          7.8Gi       2.1Gi       5.7Gi

Thank you for your replies. The program in question is called ā€œautostartā€, I mentioned that several times in my original post, besides the topic where it is mentioned. I can imagine itā€™s confusing, because ā€œautostartā€ would usually be seen as a feature thatā€™s being used or not, but the program in question that is in the programs list is just called ā€œautostartā€.

Here the results of the various commands:

Nov 13 17:59:15 my-desktop systemd[1]: Starting System Suspend...
Nov 13 17:59:15 my-desktop systemd-sleep[20628]: Successfully froze unit 'user.slice'.
Nov 13 17:59:15 my-desktop systemd-sleep[20628]: Performing sleep operation 'suspend'...
Nov 14 10:49:22 my-desktop systemd[1]: systemd-suspend.service: Deactivated successfully.
Nov 14 10:49:22 my-desktop systemd[1]: Finished System Suspend.
Nov 14 10:49:22 my-desktop systemd[1]: systemd-suspend.service: Consumed 1.396s CPU time, 1.5M memory peak.
Nov 14 12:17:17 my-desktop systemd[1]: Starting System Suspend...
Nov 14 12:17:18 my-desktop systemd-sleep[42014]: Successfully froze unit 'user.slice'.
Nov 14 12:17:18 my-desktop systemd-sleep[42014]: Performing sleep operation 'suspend'...
Nov 14 16:04:47 my-desktop systemd[1]: systemd-suspend.service: Deactivated successfully.
Nov 14 16:04:47 my-desktop systemd[1]: Finished System Suspend.
Nov 14 18:33:27 my-desktop systemd[1]: Starting System Suspend...
Nov 14 18:33:28 my-desktop systemd-sleep[72292]: Successfully froze unit 'user.slice'.
Nov 14 18:33:28 my-desktop systemd-sleep[72292]: Performing sleep operation 'suspend'...
Nov 15 09:34:12 my-desktop systemd[1]: systemd-suspend.service: Deactivated successfully.
Nov 15 09:34:12 my-desktop systemd[1]: Finished System Suspend.
Nov 15 13:11:15 my-desktop systemd[1]: Starting System Suspend...
Nov 15 13:11:16 my-desktop systemd-sleep[91708]: Successfully froze unit 'user.slice'.
Nov 15 13:11:16 my-desktop systemd-sleep[91708]: Performing sleep operation 'suspend'...
Nov 15 15:39:28 my-desktop systemd[1]: systemd-suspend.service: Deactivated successfully.
Nov 15 15:39:28 my-desktop systemd[1]: Finished System Suspend.
Nov 15 15:39:28 my-desktop systemd[1]: systemd-suspend.service: Consumed 3.775s CPU time, 1.5M memory peak.
Nov 15 18:20:36 my-desktop systemd[1]: Starting System Suspend...
Nov 15 18:20:37 my-desktop systemd-sleep[104389]: Successfully froze unit 'user.slice'.
Nov 15 18:20:37 my-desktop systemd-sleep[104389]: Performing sleep operation 'suspend'...
ā—‹ systemd-suspend.service - System Suspend
     Loaded: loaded (/usr/lib/systemd/system/systemd-suspend.service; static)
     Active: inactive (dead)
       Docs: man:systemd-suspend.service(8)

Nov 19 17:54:46 my-desktop systemd-sleep[254192]: Performing sleep operation 'suspend'...
Nov 20 10:45:15 my-desktop systemd[1]: systemd-suspend.service: Deactivated successfully.
Nov 20 10:45:15 my-desktop systemd[1]: Finished System Suspend.
Nov 20 10:45:15 my-desktop systemd[1]: systemd-suspend.service: Consumed 1.311s CPU time, 1.5M memory peak.
Nov 20 12:23:59 my-desktop systemd[1]: Starting System Suspend...
Nov 20 12:23:59 my-desktop systemd-sleep[259151]: Successfully froze unit 'user.slice'.
Nov 20 12:23:59 my-desktop systemd-sleep[259151]: Performing sleep operation 'suspend'...
Nov 20 15:23:27 my-desktop systemd[1]: systemd-suspend.service: Deactivated successfully.
Nov 20 15:23:27 my-desktop systemd[1]: Finished System Suspend.
Nov 20 15:23:27 my-desktop systemd[1]: systemd-suspend.service: Consumed 1.496s CPU time, 1.6M memory peak.

That says

-- No entries --
  • What happens when you do actually terminate it?
  • Can you disable your custom autostart.sh script, reboot, and then describe your status; is this condition then gone?

Perhaps the content of the script might help others discern if the script is contributing:

cat /path/to/autostart.sh

and paste the output.

1 Like

Okay, the question was aimed at finding out what it does - most of the time that can be deduced from the name.
Not in this case, apparently.
Is it a script or something that you wrote and decided to give it that name?
If it is ā€¦ what does it do or is it supposed to be doing?
If it is not ā€¦ where did it come from?

Iā€™d guess this to be important initial information if you are wondering why it apparently behaves like it does.

If you mean it appears in the System Monitor Applications panel but not in the Processes panel then it may be that the Name column is not helping you. The Applications panel allows the columns to be configured and one column is Command which would show the actual command nameā€¦ which I would think should match something in the Processes panel.

(When I tried adding the Command just now, column I had to resize other columns to actually see it.)

Please provide the output of the following two commandsā€¦ :point_down:

ps aux | grep -i autostart | grep -v grep
locate -i autostart

ā€¦ and certainly Nextcloud, from what I just read of the programā€™s description.

@DrMartinus This could be buffering stuff for online sync., and checking with the online server? Try temporarily disabling that. :wink:

EDIT:
I suppose I ought to do some research on what Nextcloud actually is first, before commenting!

In the System Monitor applications list, there is an option at the top to ā€œShow Details Sidebarā€. If you activate that, you should see the list of running processes associated with that application:

Also, and this may be nothing, but I noticed that that when I ran the systemctl status systemd-suspend command on my mini-PC, there was a line that was missing from your output:

Nov 21 09:02:51 scott-ser systemd-sleep[3439246]: Successfully thawed unit 'user.slice'.

As I said, it may be nothing, but I do recall seeing a note about potential problems with suspending user.slice in a recent update announcement.

2 Likes

I terminated ā€œautostartā€, and all programs which were running were terminated. This is obviously my own script which is listed there. I also checked at restart before the script was executed, no autostart in the programs list of systemmonitor. The script is invoked manually, so itā€™s easy to check.

Here a snippet from that skript.

kdialog --title "Autostart-Skript" --yesnocancel "Shall I start Dolphin?"
result=$?
#echo $result
if [ $result = 0 ]
then
    wmctrl -s 0
    kdialog --title "Starting Dolphin..." --passivepopup 20
    dolphin &
    kdialog --title "Autostart-Skript" --yesnocancel "Dolphin has been started. Shall I start Thunderbird?"
    result=$?
elif [ $result = 1 ]
then
    kdialog --title "Autostart-Skript" --yesnocancel "Dolphin wasn't started. Shall I start Thunderbird?"
    result=$?
elif [ $result = 2 ]
then
    kdialog --title "Script was terminated!" --msgbox
    exit 2
fi

This repeats until the end for the various programs which I use regularly. At the end, there is an ā€œexitā€ command, but that doesnā€™t remove it from the programs list.
I think the increase in RAM consumption is most likely by Firefox, which has many tabs open and has always consumed an increasing amount of RAM.
Just FYI: I am not starting >90 process, itā€™s more like ten programs, but Firefox opens a huge number of processes for the various tabs. I guess that is a known fact.
I created this script after I had a lot of problems with the function to restart as it was left (Iā€™m not sure how this is called in English) or to include those programs in the autostart section of the system settings (particularly as I spread out the programs over various virtual desktops, which canā€™t be done in this section as far as I know).
The programs I usually keep open are KFind, Strawberry, XSane, LibreOffice, Cherrytree, Thunderbird, Firefox, Insync, Konsole, Dolphin.

The remaining question would be, why the RAM consumption increases every time after the suspension, because it should remain the same as before, shouldnā€™t it?
Thank you for all your support in this!

Firstly, forgive me if Iā€™m misunderstanding the actual question.

It seems that you run this script manually, it launches a selection of applications, and then terminates. An average of 90 processes are spawned as a result.

Firefox, Chromium based browsers, and any Chromium based (Electron#) applications are known to consume more RAM; and the amount can increase with continued usage.

The 400MB amount you mentioned actually seems quite minimal in comparison to some instances Iā€™m aware of.

@scotty65 mentions:

I seem to recall something similar. It may be worthwhile reading through recent update announcements.

You are seeing it correctly. The observation about which I am wandering is the sudden increase after a suspension, i.e. after the PC has been put to sleep (not switched off) and than awoken again. After that, I see an immediate increase in used RAM ( a few GB) on the RAM usage graph which sits on my desktop as a widget or however this is called for plasma. While the PC is awake, the increase usually isnā€™t that enormous (yesterday seems to have been an excemption).

Iā€™ll do that.

It would be this;
https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#System_freezes_for_60_seconds_and_then_wakes_back_up_or_hangs_after_waking_up

2 Likes

This was from the Stable Update 2024-10-01 announcement; with the heading System freeze on suspend: