Score:2

nemo-desktop taking too much RAM

cn flag

On Ubuntu 22.04 I am using nemo-*. It's nice to use, but it has 2 core memory leaks.

  1. Nemo - the file manager - here I usually am able to just close all the folder windows which kills the process and then open the folders again from scratch.

  2. nemo-desktop - this is something I found answers mainly for CPU usage elswhere or some thumbnail clearance - for example here they are recommendations how to reduce the thumbail overload: https://askubuntu.com/a/575024/277898

I am "sharing the knowledge" here for the point 2. See my answer.

Score:2
cn flag

I originally thought nemo-desktop is for the whole GUI, it is not.

It's literally just that - a "desktop" app = it means it displays the icons on the desktop, nothing more. Not even the taskbar neither windows are tied to it...

This means it can be shutdown and restarted with no issues Resulting in reseting the RAM usage.

A. TL;DR Don't use the Desktop icons on the Desktop?

You can just nemo-desktop --quit.
Don't worry, Nemo file manager and "display desktop" (Super+D) will still work the same ;-)

B. You need the Desktop icons

  1. Open the terminal
  2. nemo-desktop --quit - should end with "Killing nemo-desktop, as requested"
  3. wait a few seconds for it to kill the nemo-desktop process (the quit seems to be asynchronous)
  4. nemo-desktop > /dev/null 2>&1 & disown nemo-desktop (explanation below)
  5. That's ALL => you can now close the terminal (see explanation below)

Explanation of nemo-desktop > /dev/null 2>&1 & disown nemo-desktop

  • nemo-desktop is rerunning the nemo-desktop

  • 2>&1 is redirecting standard error(2) to the standard output(1)

    • the & here means it's a special file for standard output and not just some text file called "1" (more info)
  • > /dev/null is redirecting standard output to the oblivion (to null/nowhere)

  • & in the middle means run the command in the background - allows to run other commands while this is running

  • the other command disown unattaches the jobs/command runs from the current terminal - this allows us to close the terminal safely (5.) without the process we ran being killed

  • disown doesn't need the job name, but it can be provided as I did (disown nemo-desktop) to be more explicit and allow closing other attached jobs that you want to be closed when the terminal closes - but yes, to keep everything running it would just be disown and you can use it independetly anytime before you close the terminal to keep everything running what you've ran.

Note - there is no sudo - nemo-desktop is being run by normal user on purpose.

I am still not sure what is the root cause of the memory leak over time - since it's definitely not about thumbnails - I have cleared the thumbnail cache, set its settings to low size only and generally don't have that many thumbnail-related files. If this cause is resolved/found fix for any time in the future - feel free to comment or edit.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.