Fedora 上的桌面环境内存占用测试
桌面环境 Fedora
![](/data/attachment/album/201912/31/110051vfaepxfs4dd4cays.jpg)


Fedora 中有 40 多种桌面环境（DE）。每种桌面环境都有自己的优点和缺点。通常，根据功能、外观和其它品质，选择桌面是一件非常个人的偏好。但有时，你选择的桌面环境还会受到硬件限制。


本文旨在帮助人们根据桌面环境占用的基准内存来比较 Fedora 桌面环境。为了缩小范围，我们仅查看具有正式 Fedora Live 镜像的桌面环境。


### 安装与系统配置


每个桌面环境都安装在自己的 KVM 虚拟机上。每个虚拟机都有 1 个 CPU、4GB 内存、15GB virtio 固态磁盘，以及 RHEL 8.0 kvm 上所有其他标准配置。


用于安装的镜像是标准的 Fedora 31 Live 镜像。对于 GNOME，该镜像是 “Fedora 工作站”。对于其它桌面，使用了相应的 Spin 版本。未对“<ruby> 糖葫芦 <rt>  Sugar On A Stick </rt></ruby>”（SOAS）进行测试，因为它不容易安装到本地驱动器上。


用 Live CD 启动虚拟机，然后选择“安装到硬盘”。在安装过程中，仅使用默认值。创建了一个 root 用户和一个普通用户。安装并重新启动后，live 镜像已确认不在虚拟 CDROM 中。


每个桌面环境的设置都没有改动。它们每个都以 Live CD 环境中默认的设置运行。每个桌面环境都是通过普通用户登录的。打开了一个终端，在每台虚拟机中都使用 `sudo` 运行了 `dnf -y update`。在更新后，在该 sudo 终端中，每台虚拟机都运行 `/sbin/shutdown -h now` 以关闭。


### 测试方式


每台机器都已启动。桌面环境已通过普通用户登录。打开了三个桌面终端。xterm 从未使用过，始终用的是该桌面环境的终端，例如 konsole。


在一个终端中，启动 `top` 并按下 `M`，以显示按内存排序的进程。在另一个终端中，一个简单的 `while` 循环每 30 秒显示一次 `free -m`。第三个终端闲置。


然后，我等待了 5 分钟。这样就可以让所有启动的服务都启动完成。我记录了最终的 `free` 结果，以及 `top` 中最终的前三名内存使用者。


### 结果


* Cinnamon
	+ 使用了624 MB
	+ cinnamon 4.8% / Xorg 2.2% / dnfdragora 1.8%
* GNOME
	+ 使用了 612 MB
	+ gnome-shell 6.9% / gnome-software 1.8% / ibus-x11 1.5%
* KDE
	+ 使用了 733 MB
	+ plasmashell 6.2% / kwin\_x11 3.6% / akonadi\_mailfil 2.9%
* LXDE
	+ 使用了 318 MB
	+ Xorg 1.9% / nm-applet 1.8% / dnfdragora 1.8%
* LXQt
	+ 使用了 391 MB
	+ lxqt-panel 2.2% / pcmanfm-qt 2.1% / Xorg 2.1%
* MATE
	+ 使用了 465 MB
	+ Xorg 2.5% / dnfdragora 1.8% / caja 1.5%
* XFCE
	+ 使用了 448 MB
	+ Xorg 2.3% / xfwm4 2.0% / dnfdragora 1.8%


### 结论


我会让数字说明一切。


请记住，这些数字来自默认的 Live 安装环境。如果删除或添加服务和功能，则内存使用量将发生变化。但是，如果要根据内存消耗确定桌面环境，这是一个很好的基准。




---


via: <https://fedoramagazine.org/fedora-desktops-memory-footprints/>


作者：[Troy Dawson](https://fedoramagazine.org/author/tdawson/) 选题：[lujun9972](https://github.com/lujun9972) 译者：[wxy](https://github.com/wxy) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
There are over 40 desktops in Fedora. Each desktop has it’s own strengths and weaknesses. Usually picking a desktop is a very personal preference based on features, looks, and other qualities. Sometimes, what you pick for a desktop is limited by hardware constraints.

This article is to help people compare Fedora desktops based on the desktop baseline memory. To narrow the scope, we are only looking at the desktops that have an official Fedora Live image.

### Installation and Setup

Each of the desktops was installed on it’s own KVM virtual machine. Each virtual machine had 1 CPU, 4GB of memory, 15 GB virtio solid state disk, and everything else that comes standard on RHEL 8.0 kvm.

The images for installation were the standard Fedora 31 Live images. For GNOME, that image was the Fedora Workstation. For the other desktops, the corresponding Spin was used. Sugar On A Stick (SOAS) was not tested because it does not install easily onto a local drive.

The virtual machine booted into the Live CD. “Install to Hard Disk” was selected. During the install, only the defaults were used. A root user, and a regular users were created. After installation and reboot, the Live image was verified to not be in the virtual CDROM.

The settings for each desktop was not touched. They each ran whatever settings came default from the Live CD installation. Each desktop was logged into via the regular user. A terminal was opened. Using sudo each machine ran “dnf -y update”. After update, in that sudo terminal, each machine ran “/sbin/shutdown -h now” to shut down.

### Testing

Each machine was started up. The desktop was logged into via the regular user. Three of the desktop terminals were opened. xterm was never used, it was always the terminal for that desktop, such as konsole.

In one terminal, top was started and M pressed, showing the processes sorted by memory. In another terminal, a simple while loop showed “free -m” every 30 seconds. The third terminal was idle.

I then waited 5 minutes. This allowed any startup services to finish. I recorded the final free result, as well as the final top three memory consumers from top.

### Results

- Cinnamon
- 624 MB Memory used
- cinnamon 4.8% / Xorg 2.2% / dnfdragora 1.8%

- GNOME
- 612 MB Memory used
- gnome-shell 6.9% / gnome-software 1.8% / ibus-x11 1.5%

- KDE
- 733 MB Memory used
- plasmashell 6.2% / kwin_x11 3.6% / akonadi_mailfil 2.9%

- LXDE
- 318 MB Memory used
- Xorg 1.9% / nm-applet 1.8% / dnfdragora 1.8%

- LXQt
- 391 MB Memory used
- lxqt-panel 2.2% / pcmanfm-qt 2.1% / Xorg 2.1%

- MATE
- 465 MB Memory used
- Xorg 2.5% / dnfdragora 1.8% / caja 1.5%

- XFCE
- 448 MB Memory used
- Xorg 2.3% / xfwm4 2.0% / dnfdragora 1.8%


### Conclusion

I will let the numbers speak for themselves.

Remember that these numbers are from a default Live install. If you remove, or add services and features, your memory usage will change. But this is a good baseline to look at if you are determining your desktop based on memory consumption.

## ANATOLIY KOTOV

“KDE

733 MB Memory used”

I usually have 450-500mb ram at startup

## ANATOLIY KOTOV

did not notice the “Testing” section

then the results from other DE are not clear

I got the same results on a bare system without tests

## Norbert J.

Very helpful article, especially for users of VMs or older hardware. Many thanks for the effort put into this comparison.

In my case also firewalld and sssd_nss are listed as top memory consuming processes on an idle system, but I guess those services are not mentioned because they are common to all Spins.

I also wonder what some of the many enabled services on current Fedora installations are good for and which of them can be safely disabled without breaking essential functions. If by chance any documentation exists about this topic a reference would be greatly appreciated.

## Troy Dawson

I started testing all the desktops, starting with a minimal install and layering up. With the smaller desktops (awesome, ratpoison, etc..) firewalld and sssd_nss were always in the top three memory consumers. So yes, I have seen that.

## Frederik

The only big surprise here is that Cinnamon is heavier than GNOME.

Have you done any comparison between running DEs in X versus Wayland?

## Troy Dawson

I have. I started testing all the desktops, starting with a minimal install and layering up. With the smaller X desktops (awesome, ratpoison, etc..) X11 was in the top 4 memory consumers. With the smaller wayland desktops, the wayland specific processes were much farther down.

## Edwin Buck

I don’t think Cinnamon was ever meant to be an optimization of GNOME, but rather a Windows 95 compatible user interface for those who just couldn’t use their computers without that “start bar”.

What is interesting is that all of those “heavy” desktops I keep hearing about are only 30% to 80% heavier than their “lightweight” counterparts.

## Paul M

Edwin Buck wrote;

I think that the lightweight desktops have become steadily more bloated.

## netnaut

Its very interesting test. In time when i had to decide which of desktop enviroments i will use, i decided to use XFCE but when i see your results i think my next enviroment will be LXDE version. Nice test.

## Darlha

Thanks for your article. One think I don’t understand is that you menintion that there are 40 desktops but you only list 7. Are the other 33 desktops listed somewhere else?

## Troy Dawson

As far as I know, there isn’t a full official list. I got my list started by using dnf search. Searching for “window manager” and “desktop” showed quite a few. But you have to weed through that list to figure out which one’s are real desktops and which ones aren’t.

I was originally going to write this article with the smallest memory footprint of all 40 desktops that I found. But that proved too complicated. For the small desktops, having pkgconf or xorg-x11-font-utils installed, changed the memory footprint by 10 Meg.

I would put the list here, but I still haven’t tested if each of those 40 are real desktops. Perhaps that would be a good next article for me. The list of desktops in Fedora, along with some minor things about the desktop.

## John

I know i3wm is not desktop but a window manager but only takes 230MB

## Troy Dawson

This depends on the definition of a desktop. Sometimes the definitions of “window manger” and “desktop” can be blurry. In the past, you were able to setup KDE to use the icewm as it’s window manager. But you can also run IceWM by itself.

My definition of a desktop is if you can run it by itself. It may or may not have certain features, but if it run’s by itself, I consider it a desktop.

That being said, yes, i3 was one of the “desktops” that I tested when I was trying to test all 40 desktops, and it certainly had a smaller memory footprint.

## hammerhead corvette

If i3wm is not a desktop, neither is Gnome. In my humble opinion that is… Simply because neither have a traditional “desktop”

## icywind

Many people think Gnome uses much more memory than other desktops because Gnome system monitor shows cashed memory as used.

## Pat Kelly

This is Great! Knowing everything you can about the choices before choosing is a very good thing.

When I first starting using Fedora, Gnome was and still is sort of the “flagship” desktop. I stuck with it because of that. At the time I wasn’t used to this type of desktop, but in the spirit of trying new things I got to like it. That status sort of assures that it gets lots of care in the form of updates and bug fixes.

I think it’s great that the spins exist. Flagships usually evolve slowly so they don’t disturb the environment for the users too much. The spins can evolve faster as I think is demonstrated by the fact that there are so many of them. They can also provide indicators of directions that might be good for the flagship to go.

## Shadilay

Cinnamon became buffy 🙁

KDE looking and feeling better than ever.

## Ivan

All of these (except for KDE) seem like underestimates. Maybe it’s my hardware, maybe it’s because I’m not waiting on startup processes, but I get memory usage of about 1.1 GB idle on Fedora’s live USB

## Troy Dawson

I only used the live usb as a means to install on a hard drive. After it was installed on the hard drive I made sure the live usb wasn’t on the system.

If you are running just the live usb, it is going to use more memory. The live usb, running as a live usb, does alot more memory caching. I’m not sure of all the settings, but it is running read-only, and I believe tuned for slower disks.

## Mark

Memory used is a good start in comparing them, thanks for the post and the effort involved in testing them all.

I would be interested in the number of running processes each desktop environment spawns as well should you ever feel tempted to redo the tests one day.

On a F31 ‘server’ without Gnome or any desktop packages installed running 3 KVM systems, a webserver, bacula and lots of other stuff. 4 core + 8Gb mem

ory, 2 external encrypted disks and an encypted internal one.

[mark@vmhost1 snort]# ps -ef | wc -l

190

[mark@vmhost1 ~]$ ps -ef | grep ‘[’ | wc -l

119

On a F31 desktop with Gnome intsalled logged onto the GUI desktop with no applications other than one terminal window open, plus a bacula, synergy and puppet client. All other prcesses are default services. 8 core + 32Gb memory. 1 external encrypted disk and an encypted internal one.

[mark@vmhost3 ~]$ ps -ef | wc -l

349

[mark@vmhost3 ~]$ ps -ef | grep ‘[’ | wc -l

160

I assume processes within [ ] in a ps display are system processes (lots of kworker etc) and should be subtracted to get around 71 processes I have probably had a hand in starting on the server and on the desktop 189 extra processes some of which I may have had a hand in starting.

While Gnome alone starts more processes than just those with gdm in the name a quick count of those alone gives me

[mark@vmhost3 ~]$ ps -ef | grep gdm | wc -l

49

Plus there will be all the sockets and udp pipes etc the GUI components chat to each other across, so desktop resource usage cannot be measured just by memory, although none have as great an impact as memory.

Without a GUI desktop on a KVM instance ‘server’ I have running no major apps other than nagios and a puppet client the total memory usage is just 172Mb, always seems strange to me that a GUI user interface needs more memory at idle than the entire working operating system does. Having said that I have found any attempt to run ‘dnf update’ in a kvm with less than 500mb assigned is eventually killed by the out of memory handler.

Does anyone other than me remember the old days when fedora would run the Linux OS plus a full GUI desktop and all the tools flawlessly on a machine with 256Mb of memory.

## Chicken

Try repeating the test with at least two cores and 8 Gb or Ram. (A more likely set up). Who uses one core and 4Gb of Ram? You do realise that most OS’s will grab as much memory as they can to run smoother.

## Paul M

And then install and run Google Chrome and watch it soak up another four gigabytes of RAM

## anon

” Each virtual machine had 1 CPU, 4GB of memory”

Yeah, cause that’s a standard set up. What is this 2000? You know full well that if you did the same test with 8Gb of memory that Gnome would grab more.

## Troy Dawson

Don’t I wish I could have afforded a desktop with those specs back in 2000. 🙂

But more seriously, the reason I started looking at desktop memory footprints was because I wanted a desktop running on a raspberry pi, and similar machines. For those machines, 4GB is huge.

There have been many reading this article that have thought the same thing as what you stated. So, for GNOME, I have re-ran the test in various configurations.

NOTE1: It has been a month since I originally ran my test. After updates, gsd-xsettings is now in the top 3 memory users. gnome-shell usage is also higher. You will notice that none of these runs got down to the original gnome memory usage.

NOTE2: gnome-software memory usage has been all over the place. From 40M to 180M. It also doesn’t drop off after 5 or 10 minutes either. Because these tests were testing the differences between amount of memory, and number of CPU’s, I would reboot the virtual machine until gnome-software memory usage was the same.

GNOME: 1 CPU, 4Gig memory

— 634 MB Memory used

— gnome-shell 7.2% / gnome-software 1.8% / gsd-xsetting 1.5% / ibus-x11 1.5%

GNOME: 2 CPU, 4Gig memory

— 645 MB Memory used

— gnome-shell 7.2% / gnome-software 1.8% / gsd-xsetting 1.5% / ibus-x11 1.5%

GNOME: 1 CPU, 8Gig memory

— 632 MB Memory used

— gnome-shell 3.6% / gnome-software 0.9% / gsd-xsetting 0.7% / ibus-x11 0.7%

GNOME: 2 CPU, 8Gig memory

— 647 MB Memory used

— gnome-shell 3.6% / gnome-software 0.9% / gsd-xsetting 0.7% / ibus-x11 0.7%

So, it looks like the amount of memory used, does not increase with amount of memory available. It also looks like the number of CPU’s might increase the amount of memory used, but it’s so close, that I couldn’t definitely say that, without more and better tests.

## Gareth Jones

Okay, at the opposite end of the spectrum, here’s Gnome/Wayland running on a 64 GiB Threadripper 2950X (16 cores with SMT), 5 minutes idle after log-in:

$ free -h

total used free shared buff/cache available

Mem: 62Gi 1.6Gi 58Gi 50Mi 2.9Gi 60Gi

Swap: 8.0Gi 0B 8.0Gi

Top processes:

0.4 % gnome-shell

0.3 % gnome-software

0.2 % epiphany-search (???)

This is a net-install F30, dnf upgraded to F31, with some customizations (btrfs on LUKS, extra software installed, mostly dev tools), so not very scientific. I guess the 5K monitor bumps up gnome-shell memory usage more than anything else.

## james sparks

LXDE is a vital element to acheive maximum performance with minimal use of resources. Thank you Fedora for the LXDE spin!

## KDE Fan

Akonadi is inflating KDE’s usage – not many distros install/start akonadi by default so it’s not really fair to include that. IIRC it uses full mysql DB install.

## Troy Dawson

I too am a KDE fan. I also never run akonadi on my desktop. So it was really hard for me to put those numbers up there. But, the Fedora 31 KDE live image installs, and turns on, akonadi. Maybe in Fedora 32 things will change, but with what I tested, those were the results.

## svsv sarma

Please don’t go by memory usage alone. Memory is not a big thing at all in today’s systems. A desktop should be pleasing and easy to work on also.

## Cornel Panceac

I think not only the memory footprint is important but also the I/O and of course CPU should be counted in. Probably this is why, on a slow Pentium D525 computer with 2 GB of RAM, the LXQT feels faster than LXDE, XFCE or (god forbid) GNOME. Unfortunately, the request for adding I/O data to the GNOME system monitor was just ignored at the time of request. It would have provided interesting insights on how much packagekit and tracker impacts the rotational disks performance in Gnome (or how much of SSD data is used for these two performance hitters).

And yes, to answer indirectly to a question above, i still remember starting my first desktops in slackware 1.0 on 4 MB of RAM, or running Starcraft in Wine in Gnome on a system with Pentium 200 MMX and 64 MB of RAM.

And also i still see new releases claiming they are faster then the previous ones …

## El Venas gruesas

Están pero si bien pendejos como KDE 733 megas?

Díganle a Federico Mena que mejor se ponga las pilas el cabrón y vean la forma de que gnome no se la como doblada, La Memoria ram

## noots

Interesting, looks like GNOME has been optimized!

My desktop benchmarks (with all my customizations installed) when idle are as follows:

Gnome – ~1.8GB

Cinnamon – ~1.1GB

XFCE (Debian) – ~700MB

LXQT (Ubuntu) – ~700MB

Each includes nm-applet, firewalld, avahi, ntp, CUPS etc running.

## Andy

What gtk+ version is the current LXDe using? gtk+2 or gtk+ 3?

## eeee

w3m ?

simple x-windows and twm ?

## JCjr

I’ve been looking at SwayWM on Wayland for a simpler desktop than GNOME. I just wish setup was easier. There’s some docs on the the Github page that detail some of the ways to make it a usable desktop (adding a launcher and utilities, etc.) as well as some [conflicting/outdated] documentation from the Arch docs, but it still looks like a lot of manual work to make it functional. Anybody using it as their daily-driver?

## Paul M

can you try this as a desktop:

https://www.nongnu.org/ratpoison/

and reports its memory usage?

I know it’s not strictly a desktop, but it gives you a substitute for a window manager.

## Mohamed

I’m using i3wm and polybar, I would like to know the memory footprint of it, how can I do that?

Thank you

## Esteban Wilson

good article! Appreciate the reported metrics for the respective desktops. Comes in handy to know the footprints when trying to virtualize GUI applications. Been using xvfb+joe+x11vnc. Another small footprint is xvfb+icewm++x11vnc. LXDE works also. Always good to see article like this.

## Tom Kidd

I don’t like the part about “KDE” as it is I think incorrect. First of all desktop is Plasma 5 and not KDE… KDE is just a brand for community which makes software, so KDE is people, and piece of software is Plasma 5.

Brand re-positioning happen over 10 years ago: https://dot.kde.org/2009/11/24/repositioning-kde-brand

And having “KDE – 733 MB Memory used” clearly states that some kind of bloatware was in the system. On fresh install KDE Plasma consumes on my system no more than 400MB of RAM.

## Troy Dawson

You are correct. The Fedora Spins page clearly says “KDE Plasma Desktop”. I should have used that full name. Just using KDE was lazy of me.

As for the bloatware, it’s akonadi. When you install the Fedora 31 KDE Plasma Live Spin to your machine, the entire akonadi suite is turned on. In the article, I only show the first akonadi component, but there was over 10 components running, and 4 of them were using as much memory as akonadi_mailfil.