Does she still need to create a swap partition given that she has this amount of RAM?

Hi guys,

A computer belonging to my BFF has Intel i7 12th generation CPU, 1TB of Samsung NVMe PCIe Gen 4 SSD and 32GB of DDR5-4800MHz RAM.

  1. Does she still need to create a swap partition?

  2. If yes, what size should it be?

  3. Will having a swap partition lead to degradation of the performance of the NVMe PCIe SSD?


Fedora will install and set up swap by default.My default install set up around 8 gig of swap.You may never need it but it doesn’t hurt anything.As far as wearing out the drive no it will not cause the drive to degrade or hurt the performance.

This depends on what you are doing with it. Most of today’s “average use cases” will not need swap with such an amount of RAM. But I do not know if you are average.

Like the argument above: it depends on what you doing.

If you have a swap while your system does not need it, the answer is simply no: because it will not be used anyway. If your system has the need to use the swap despite 32GB RAM, it will occupy NVMe bandwidth to the extent the swap is in use.

In short, if your system does not need it, it won’t affect performance. But if your system needs it, the negative performance impact of not having swap available would be worse than the impact of the occupied NVMe bandwidth of available swap.

Besides that, it only occupies its space. 1GB swap means 1GB less to be used for other disks :wink:

However, you can simply try to not create a swap partition for now but leave some space of the NVMe unallocated in case you later want to create a swap. Then, you can check if your RAM is sufficient.

The command free might help you to create indication in either case. But as indicated before, in the overall result, swap will not create negative performance impacts in either case but at the worst, only occupy some disk space (at the best, improve performance if 32GB are not sufficient for whatever memory-intensive tasks you conduct).

I have 16 GB of RAM.
I do a lot of design related things, photo and video editing.
I deleted my Swap file as I was running Zorin OS for a year and also deleted my swap after a few months.
I never needed it.

If you don’t do all I mentioned togehter plus watching Youtube and having 30 Tabs open you don’t really need a swap.

She should just check the RAM used while she is doing heavy stuff and if it is not even close to 32 she can delete the Swap

I can’t find it in Fedora’s official documentation. Can you point me in the right direction please?

Fedora uses zram for swap as default.
Use the command zramctl to observe the actual swap space usage.
My system shows

$ zramctl
/dev/zram0 lzo-rle         8G   4K   80B   12K      12 [SWAP]

$ free
               total        used        free      shared  buff/cache   available
Mem:        32789412    13001216     9806484      131336     9981712    19190612
Swap:        8388604           0     8388604

$ uptime
 11:12:22 up  2:02,  1 user,  load average: 6.05, 5.62, 5.61

with 32GB ram running boinc, chrome with 16 tabs, and playing a video on plex media server. I have an amd rhyzen 5 3600 processor with 6 cores 12 threads and only about 43% cpu load.

I seriously doubt you need to set up a physical swap, but as said it depends on your use case.

In over 2 years on this system I have never seen more than 60% of the RAM in use.

Jeff explained it a lot better that I could. Zram is what I was referring to as default.

1 Like

Hmm… I think we should differentiate here a little bit.

zram as swap (as default) is not equal to traditional swap partitions the author was asking for.

Traditional swap partitions are an interim storage of data that belongs to the RAM but that is not necessary at RAM at the very moment, and moved to swap on a disk in order to free space in RAM that is required for something else.

The zram use as swap is a swap within the RAM (it creates a disk-like block device within RAM with compression for swap use). This means that it cannot fulfill the original purpose to free RAM the traditional way, as it is within RAM. Instead, it makes the RAM more efficient and introduces, e.g., compression (<50%) for data that is not currently in use, so that more can be stored in the RAM (which further decreases use cases for traditional swap partitions). How much RAM is used for zram-swap is nothing you need to care about.

So, when adding a swap partition, you would have two levels of swap, which implies 3 stages: RAM, zram-swap within RAM, swap partition on disk. See Changes/SwapOnZRAM - Fedora Project Wiki

On most systems, zram-swap is sufficient and a traditional swap partition is not necessary: but it depends on the use case. Anyway, dedicated swap partitions are not created by default anymore (because it is not necessary in most cases). And it will be hard to fill 32 GB RAM, as Jeff already indicated. You need to do a lot of memory-intensive stuff before it makes sense to think about adding a dedicated swap partition. If you are unsure, I guess you do not need a separated swap partition. But we can neither make the decision for you, nor indicate without further information.

While this is all true, it does not simplify the answer to the original question. It has been mentioned more than once that it depends on the use-case whether a physical swap space is required.

It has also been noted that in most cases a physical swap is not necessary.

There are 2 distinct times when a physical swap is required (possibly more).

  1. The user intends to hibernate the system which will require physical swap at least as large as the RAM.
  2. The way the system is used causes filling of the virtual swap to the point where it is impacting system performance and additional swap space is needed. This situation may even involve oom monitors causing shutdowns.

If the user does not fit either of those cases then physical swap is likely not needed.

Well, I prefer to not limit the use cases to two. There are more, but most will not apply here. But as you said: everything has been said :slight_smile: We don’t have information for more elaboration.

First of all, I wish to thank both you and @computersavvy for giving detailed answers to my questions. I think my BFF does not need to create a separate swap partition.

Secondly, according to her, she uses Adobe Photoshop from time to time. The software is only available for Microsoft Windows users.

GiMP and/or Darktable are greate alternatives to Photoshop.
She will be fine without Swap

Thanks but if I am not wrong, Adobe Photoshop is the de facto software of choice among creative professionals. GIMP is a poor second.

I’m not sure what your question is at this point. However, I suggest to open a new thread for this.

I could imagine that we have other people at ask.fedora who need to use software like this as well. Maybe it can be made running with wine or such, maybe there are suitable alternatives, or maybe there is a browser-based version/alternative or such (or virtualize it).

But this belongs in a dedicated thread whose topic attracts people who know about it :wink:

I am sorry if I confused you.

I mentioned Adobe Photoshop to illustrate that my BFF does her creative work using Microsoft Windows, not Linux or BSD distros.

If I am not wrong, she uses Linux for non-creative work.