Do you feel Ubuntu 17.10 is slow and heavy? Do you find it's difficult to run Firefox and others without lagging? That's because Ubuntu has so many processes running at once that are unnecessary for most users. Among them are redundant gnome-shell, gsd-somethings, evolution-somethings, and many more. Ubuntu 17.10 uses at least 1GiB of RAM at idle and that is too heavy for a desktop system. This article explains some experiments in reducing RAM usage down to ±600MiB by disabling those unnecessary processes from Ubuntu. The final result is for you wanting to run Ubuntu 17.10 faster and more stable (without lagging). Please do these experiments at your own risk. Enjoy!
Subscribe to UbuntuBuzz Telegram Channel to get article updates directly.
WARNING: although all experiments here are harmless, I recommend you to do these experiments on a Ubuntu Desktop 17.10 that is dedicated for experimenting, not for production.
This article is an experimental tutorial. If you want something else for 17.10, read How To Install, What To Do After Install, Newbie's Guide, and Recommended Applications.
The Result
I show you my result after reducing unimportant processes. Before, System Monitor says my Ubuntu 17.10 eats 1.0GiB of RAM. After, it says it eats only ±600MiB of RAM. Can you see the far difference? You can do it by yourself.
Only using ~668MiB at idle time |
Why?
Run your System Monitor program > set the view to "All Processes" > sort Memory column from-big-to-small. You will see so many processes running at once. Many of them are 'the culprits' of heavy memory-load in Ubuntu. And many of them actually not necessary for a healty, normal Ubuntu system.
Targets
The operation targets of these experiments are:
- gsd-something processes, at least 39 of them
- evolution-something processes, at least 6 of them
- gnome-shell processes, there are 2 of them
- snapd, there is 1 process
- packagekitd, there is 1 process
They're all automatically respawned if you just close them using kill command. Therefore this article exists to kill them permanently (except gnome-shell). Plus, excluding gnome-shell, there are targets you can kill that I still don't know how to permanently kill them such as gnome-calendar, update-notifier, and deja-dup-monitor.
What we will do?
- Kill one of two gnome-shell process. See memory usage.
- Refresh gnome-shell process if you find it exceeds 100MiB. See memory usage.
- Kill 30+ processes named gsd-something. See memory usage.
- Delete* 30+ actual files of gsd-something processes. Restart. See if they're back or not. See memory usage.
- Kill 6 processes named evolution-something. See memory usage.
- Delete* 6 actual files of evolution-something processes. Restart. See if they're back or not.
- Finally, see memory usage. We should have much more free RAM here.
- You can restore these experiments back if you dislike the result.
*) Of course, we will not simply "delete" the files but just "move" them to new folder.
See the Default RAM Usage
You will see at first login that Artful uses ±1GiB-1.3GiB of RAM. If you have only 2GB RAM, this causes Artful to be very slow and heavy, you will find difficult even to run Firefox. Compare it: remember that Kubuntu uses only 400MB of RAM.
1. Kill Redundant gnome-shell
Login and open System Monitor > click triple-lines button > check on Dependencies > find 'gnome-shell' > you should find 2 gnome-shell with 2 different users. One with your own username, and another one with gdm username.
Kill the gnome-shell with gdm username.
Now you should see only one gnome-shell exists with your username.
Kill the gnome-shell with gdm username.
Now you should see only one gnome-shell exists with your username.
WARNING: this killing is not permanent. You must do it again each time you logged in.
2. Kill gsd-somethings
To to this permanently: delete all gsd-somethings files inside /usr/lib/gnome-settings-daemon/ then restart Ubuntu. This makes gsd-somethings never respawn. Again, I suggest you to not delete but instead move them to another folder.
First, mkdir a new folder in /usr/lib/gnome-settings-daemon/:
Second, mv all files into backup/ folder:
Third, make sure all files are gone. This command must show only one backup/ folder.
Fourth, restart Ubuntu. System Monitor must show no gsd-something running.
Fifth, now see RAM consumption at System Monitor.
To be killed permanently |
First, mkdir a new folder in /usr/lib/gnome-settings-daemon/:
$ sudo mkdir /usr/lib/gnome-settings-daemon/backup/
Second, mv all files into backup/ folder:
$ sudo mv -v /usr/lib/gnome-settings-daemon/gsd-* /usr/lib/gnome-settings-daemon/backup
Third, make sure all files are gone. This command must show only one backup/ folder.
$ ls /usr/lib/gnome-settings-daemon/
Fourth, restart Ubuntu. System Monitor must show no gsd-something running.
They are all gone |
Fifth, now see RAM consumption at System Monitor.
Reduced down to 860MiB! |
3. Kill evolution-somethings
To do this permanently: delete all evolution-somethings files inside /usr/lib/evolution/ then restart Ubuntu. Do not delete but simply move them instead.
First, mkdir a backup directory:
Second, mv them all:
Third, make sure all evolution-somethings are gone:
Fourth, restart Ubuntu.
Fifth, make sure System Monitor show nothing more evolution-somethings:
Sixth, see RAM usage.
Before (all evolution-somethings are active) |
First, mkdir a backup directory:
$ sudo mkdir /usr/lib/evolution/backup/
Second, mv them all:
$ sudo mv /usr/lib/evolution/evolution-* /usr/lib/evolution/backup/
Third, make sure all evolution-somethings are gone:
$ ls /usr/lib/evolution/
Fourth, restart Ubuntu.
Fifth, make sure System Monitor show nothing more evolution-somethings:
After (all evolution-somethings killed and cannot respawn) |
Sixth, see RAM usage.
Reduced down more to 750MiB! |
4. Kill packagekitd
PackageKit is a particular "automatic updater" in Ubuntu. It has packagekitd daemon running randomly over time so it's difficult to track when it's started and closed. The bad news are: packagekitd can waste your network bandwidth and RAM. You don't need packagekitd to run Ubuntu normally. So disable it.
First, mkdir a backup folder:
Second, mv it to backup/ folder:
Third, kill the process:
Fouth, restart Ubuntu and make sure no packagekitd running.
Fifth, see RAM usage.
First, mkdir a backup folder:
$ sudo mkdir /usr/lib/packagekit/backup/
Second, mv it to backup/ folder:
$ sudo mv -v /usr/lib/packagekit/packagekitd /usr/lib/packagekit/backup/
Third, kill the process:
$ sudo killall packagekitd
Fouth, restart Ubuntu and make sure no packagekitd running.
Fifth, see RAM usage.
5. Kill snapd
Similar to packagekitd, Snappy is a particular "software installer" in Ubuntu. Snappy has snapd daemon running over time so it's also difficult to track when it started and closed. The same sad news are: snapd can waste your bandwidth and RAM. Again, just like packagekitd, you don't need snapd to run Ubuntu normally. Then kill it.
First, mkdir a backup/ folder:
Second, mv the file:
Third, kill the snapd:
Fourth, restart Ubuntu and make sure no snapd running.
Fifth, see RAM usage.
I haven't found the way to permanently kill them (except manually deleting) so for now I can only kill them after logging in. They are gnome-software, gnome-calendar, deja-dup-monitor, and update-notifier. You still can run Ubuntu normally without them.
After killing them, see RAM usage.
The gnome-shell process grows over time from 60-70MiB to 120-200MiB. When it exceeds 100MiB, restart it, so it goes back to 60-70MiB. To restart gnome-shell:
After a fresh restart, and do again (1), (6), and (7) you should see the RAM usage now reduced to ±600-700MiB. Now you can try to run Firefox, Thunderbird, Nautilus, even games at once and see if Ubuntu 17.10 is not slow/heavy anymore.
Yes, this article is very limited and you can say it's ugly. I'm not a hacker and I didn't read GNOME source code to write these experiments. I did my own experiments after having hard times in running Firefox on 17.10 (it's too slow and even crashing!) in a 2GB RAM laptop. The limitations are you still have to do experiment (1), (6), and (7) manually each time plus I still don't know if there are more stuffs that could be reduced. Please let me know if you know more and have corrections for me.
I believe there are ways to find to kill more unnecessary stuffs permanently. As fas as I can grasp, here are some internal files and directories related:
First, mkdir a backup/ folder:
$ sudo mkdir /usr/lib/snapd/backup/
Second, mv the file:
$ sudo mv -v /usr/lib/snapd/snapd /usr/lib/snapd/backup/
Third, kill the snapd:
$ sudo killall snapd
Fourth, restart Ubuntu and make sure no snapd running.
Fifth, see RAM usage.
6. Kill Unnecessary Processes
I haven't found the way to permanently kill them (except manually deleting) so for now I can only kill them after logging in. They are gnome-software, gnome-calendar, deja-dup-monitor, and update-notifier. You still can run Ubuntu normally without them.
Killing some unnecessary processes (this is not permanent) |
After killing them, see RAM usage.
7. Restart GNOME Shell
The gnome-shell process grows over time from 60-70MiB to 120-200MiB. When it exceeds 100MiB, restart it, so it goes back to 60-70MiB. To restart gnome-shell:
- Press Alt+F2
- Type r
- Press Enter
- The screen shows message: "Restarting..."
- See RAM usage.
8. Final Result
After a fresh restart, and do again (1), (6), and (7) you should see the RAM usage now reduced to ±600-700MiB. Now you can try to run Firefox, Thunderbird, Nautilus, even games at once and see if Ubuntu 17.10 is not slow/heavy anymore.
Finally: only use 670MiB of RAM! |
Limitations
Yes, this article is very limited and you can say it's ugly. I'm not a hacker and I didn't read GNOME source code to write these experiments. I did my own experiments after having hard times in running Firefox on 17.10 (it's too slow and even crashing!) in a 2GB RAM laptop. The limitations are you still have to do experiment (1), (6), and (7) manually each time plus I still don't know if there are more stuffs that could be reduced. Please let me know if you know more and have corrections for me.
Further Information
I believe there are ways to find to kill more unnecessary stuffs permanently. As fas as I can grasp, here are some internal files and directories related:
- /usr/share/gnome-session/sessions/
- /usr/share/applications/
- /usr/share/gnome-session/sessions/gnome-login.session
- /usr/share/gnome-session/sessions/ubuntu.session
- Please read man gnome-shell