How to reduce swap usage in linux

How to reduce swap usage in linux. To set up a partition as Linux swap area, the mkswap(8) command is used. Nov 23, 2023 · Temporarily disable swap using the command: 1. To see swap size in Linux, type the command: swapon -s. Create a new swap file with your desired size (in this example, we will create a 4GB swap file): sudo fallocate -l 4G /swapfile. . vm. swappiness = 10. The -h flag simply states that the output should be in a human-readable format. Your system swaps the inactive pages in memory in RAM to this swap space on the hard disk. For example, say you downgraded the amount of RAM in your system from 1 GB to 512 MB, but there is 2 GB of swap space still assigned. We can create a new file within an existing partition, or we can allocate an entire partition of type swap. Then, change or add this line to the file: vm. Red Hat Customer Portal - Access to 24x7 support and knowledge. 75GB. 3 Memory Controller (Memory Cgroups) # If the memory cgroups feature is not needed, it can be switched off by passing cgroup_disable=memory on the kernel command line, reducing memory consumption of To make sure that your new swap space is activated while booting up computer, you should add it to the filesystem configuration file /etc/fstab. 10 Sec. Note: according to Plesk hardware requirements, a minimum of 1 GB swap is required for Plesk on Linux server. com Aug 21, 2015 · You may have experienced system lags, heavy swap usage, or low memory issues in your Linux system. Add it to the end of the file. How do I reduce swap utilisation on a Linux server which is running as an Oracle 11gR2 Server? Currently it shows above 80% in Enterprise Manager. field. Red Hat Enterprise Linux Apr 16, 2019 · You can forcefully clear your swap by turning swap off and on again: sudo swapoff -a. Jun 30, 2012 · For Kernel version 3. 15. 6. swapon --show. Apr 10, 2017 · Operating systems indeed use swap space to create the so called virtual memory (which is obviously bigger then the RAM you might have). Jul 12, 2012 · If your server falls below the desired amount – 20% to 30% – of available cache, you first need to determine if it has enough swap space. The free command shows free and used RAM on your system. Looking at Ubuntu's system manager, I noticed that my Swap frequently goes up to 100%, even though I still have some free ram. Aug 16, 2012 · 1. Jun 29, 2021 · If you want to disable a specific swap file or partition, provide its path like this: sudo swapoff /dev/nvme0n1p2. Some users think they need twice as much swap as there is RAM in the computer, but this is not the case. swapoff -a. Enter the starting and ending blocks for the size you want. A modern server typically has a minimum of 2 GB of swap space, and if it has more than 8 GB of RAM, it should also have about 25% of the total RAM available for swapping. Type p to print the partition table and identify available free space. In this tutorial, we’ll talk about swappiness and its current default value in the Linux kernel. Create a Swap File Aug 28, 2016 · We have provided the XMS and XMS values for the application as 6gb The machine on which the application is running has 16GB RAM. 00. Plesk does not manage swap space. On GUI-based Linux systems, you can use the System Monitor utility. Mar 18, 2024 · Linux uses the swap space when suspending to disk. While it prevents system crashes due to low memory, it can slow down the system if overused. These mechanisms help reduce unnecessary memory usage and improve system performance by identifying unused memory pages. A usual advice is to “decrease the swappiness value”, reduce the swap usage. - swapoff -Lswap (substitute your values) - swapon -s (status check to be sure that it worked) - (if status check reveals a swap line-item, then you specified incorrect swap label. Swap Space Does Not Make a System Slow. May 25, 2017 · @ mr. At OS level, there is sufficient memory for HANA database, but you find that the HANA services are using large Swap space. Enter one of the two commands, for example: top. A swap partition can be created with most GNU/Linux partitioning tools. but what is swappiness? And is it really good to tweak it? Note: we won’t go into detail about the swap partition. answered Nov 21, 2021 at 9:40. Finally, remove the actual swap. shmall -> 16GB/2. Turn off the swap partition with the command which turns off all swap space: $ swapoff -a. This will mark all swap partitions as unused by swap (then re-marking them used). The minimum expected specs with which GitLab can be run are: Linux-based system (ideally Debian-based or RedHat-based) 4 CPU cores of ARM7/ARM64 or 1 CPU core of AMD64 architecture. Press Shift+O keys to open the "Order By How do I know my swap size? Check swap usage size and utilization in Linux. Checking Swap Space Size and Usage. In other words, we need to ensure the swap file is available after a reboot. Initialize the new swap file using mkswap, then enable it for use with swapon. Remove its entry from the /etc/fstab file. You have high memory usage at some point. I don't use Chromium for anything else, but if it isn't your case you would like to change the User Data Directory for the app mode window, so that it and the regular browser windows run on separated processes with only the app window in Red Hat Customer Portal - Access to 24x7 support and knowledge. Getting started with swap. Regenerate mount units so that your system registers the new configuration: Copy. 8. The default setting in Ubuntu is swappiness=60. Do I need to delete the partition and remake it? Jul 17, 2023 · In this article, we will discuss what a swap file is, its types, and how to change the swap file size in Ubuntu. Latest data shows free swap space 0% and total swap space 5. Jul 17, 2023 · To create a new swap file with a different size, follow the steps below: Remove the existing swap file: sudo rm /swapfile. Clearing Cache, Buffer, and Swap Space in Linux. After restart of the application the swap is becoming normal. Sep 20, 2021 · 4. And here‘s sample output on my system: Focus your eyes on the "Swap" row appended to the bottom. There is Jan 16, 2016 · Swap Memory = Free Memory of Physical RAM. img. So, let’s activate our new swap file: $ sudo swapon /swapfile_extend_1GB. If --memory-swap is unset, and --memory is set, the container can use as much swap as the --memory setting, if the host container has swap memory configured. Use a more lightweight environment or create a custom environment if the current does not meet the hardware and/or personal requirements. If, for example, the swap space was already pretty occupied when you changed the Swapiness value to 10, the swap space won't suddenly get empty (Unless you've rebooted your system). sudo sysctl -p. Chapter 16. 5k 6 135 207. For apache, remove the modules you do not use, as they just use additional memory. img swap swap defaults 0 0 from the /etc/fstab file. Image/data in this KBA is from SAP internal systems, sample data, or demo systems. In certain situations, you may need to clear the cache, buffer, or swap space as explained below. Removing Swap Space. Specify the partition type as Linux swap. swap. To see if your instance is using swap space, you can use the swapon -s command. After that, we turn to swappiness, what it means, and how to set it. $ swapon --show. Increasing or decreasing SWAP doesn't affect how Linux uses your RAM. The first pass discards stale pages, to reduce the amount of I/O during the actual swap process. There is Command: $ free. Sep 15, 2013 at 13:45. img file using the rm command: sudo rm /swap. CPU utilization for each CPU or core. First, create a file which will be used as swap space: sudo fallocate -l 1G /swapfile. Remove a Swap File. Virtual Memory: Available: 4. Copied! # swapoff -v /swapfile. Or to show physical memory as well as swap usage: $ free -h Swap partition. 2. 1. It includes. Swap is a virtual memory concept that allows your system to use a portion of your hard drive as the physical memory ( RAM ). 00 2874. Jun 29, 2021 · Jun 29, 2021 — Abhishek Prakash. The rule is: Feb 24, 2022 · Swap I/O scales poorly. 5. Only when you need the memory residing in Feb 19, 2019 · In this guide, we will add 1G of swap, if you want to add more swap, replace 1G with the size of the swap space you need. Disable: # swapoff -v /dev/rhel/swap Resize: # lvresize /dev/rhel/swap -L +2G (to increase swap by 2G) Format: # mkswap /dev/rhel/swap Enable: # swapon -v /dev/rhel/swap. Using swap allows idle or unused areas of allocated memory to be relocated to disk instead of RAM. Understand that the "38%" of unused RAM is used a disk/file buffer/cache. You can not instruct the JVM to use only the physical RAM AFAIK, but that would be a limitation of the OS itself and not JVM (this should answer 5). That is Linux being economic with memory. sudo swapon -a. It has the same the target functionality is the same as that of a swapfile. So, we see that swapon displays the existing swap space of 4. As we mentioned above, this is normal behavior for Linux, so don’t worry about this. Explanations: When your RAM gets full, the kernel starts using the swap space more often (on the much slower disk drive) and applications need to wait a longer time to access their memory, degrading the performance of those applications. 976 MB of swap memory is not enough. Nov 24, 2023 · Every Linux system has three options to clear the cache without interrupting any processes or services. Share. However, the default Reducing the requirements of the user space workload will reduce the kernel memory usage (fewer processes, fewer open files and sockets, etc. Improve this answer. 5 and newer it disables swappiness. img Conclusion # Jun 9, 2015 · Swappiness is a Linux kernel parameter that controls the relative weight given to swapping out runtime memory, as opposed to dropping pages from the system page cache. # sar -q 1 3. To see some memory info I can watch it in top of through cat /proc/meminfo. See Prevent a container from using swap . Improve this question. When later, you have less memory requirements, linux leaves the swap on disk, so the memory is available for disk cache and for anything else you are doing, or plan to be doing. Type n to create a new partition. Check swapon and free commands to confirm your newly resized swap file is reported correctly. Nov 2, 2020 · On many Linux setups in the world today, there is a swap partition assigned on one of the disks within the system. shmmax --> 4420960256. In my case, swap usage doesn't reduce later on (even though memory is free) so I get an alert email every hour. Dropping buffers/cache is simply wasting performance. Swapping out pages is done in two passes. It displays information about both physical and swap Feb 26, 2018 · Mar 7, 2018. Linux only uses swap space if it’s really needed; therefore, in many cases, about 1 GB of swap space is enough, even for some busy server scenarios. Aug 16, 2010 · By default, your Linux distribution will assign some swap space to your computer. # Reduce the swap tendency vm. there is a too small piece of SwapFree ). sar -w -f /var/log/sysstat/sa10. Aug 19, 2012 · # Native memory allocation (malloc) failed to allocate 32756 bytes for ChunkPool::allocate # Possible reasons: # The system is out of physical RAM or swap space # In 32 bit mode, the process size limit was hit # Possible solutions: # Reduce memory load on the system # Increase physical memory or swap space # Check if swap backing store is full Dec 27, 2023 · The free command offers a super quick report of memory usage statistics right in your terminal, including swap info. For example: Aug 16, 2010 · By default, your Linux distribution will assign some swap space to your computer. In the "Related links" section, click the Advanced system settings option. 89. Just type in the following in the terminal : free -m. May 15, 2024 · After formatting our file as a swap file, the next step is to enable it. Sep 14, 2021 · You can use the swapon –show command to view the swap space on your system. swapped out. On the other hand, we can also use the free command, which provides a concise and human-readable summary of the system’s memory usage. Some more examples: sar -w. How do I identify which processes use swap memory in Oracle and how do I reduce it? oracle. 2. Verify the partition table and changes look correct. Tell it to display human-readable units with the -h flag: free -h. Using an optimized kernel improves performance. Expanding Swap Capacity with Partitions or Files Nov 7, 2019 · 1. First, we go over the general swap strategy of the Linux kernel. To be even safer, you could revert to run level 1 or single-user mode. /dev/zram0 partition 5. 4. Minimum 2 GB of RAM + 1 GB of SWAP, optimally 2. This is recommended because other filesystems (at least one that contains a swap file) must be mounted in read-write mode before we can access any files. Lastly Linux has allowed to use a SWAP file on any of your partitions for many years already. swappiness = 10 -save the file and restart the computer. swapon -a. Now that we‘ve covered the factors involved, let‘s see how to extend Linux swap space. Now that we’ve seen the benefits of having swap enabled, let’s address the incorrect claim that swap slows the system down. Note that this will force all swap memory into physical memory - meaning some bad things might happen if you don't have enough physical memory. 3. There's no need to allocate a dedicated SWAP partition. It might be advantageous to reduce the amount The total amount of virtual memory used by the task. e. This is a special area, usually (but not exclusively; it can be added later) reserved during the installation of the Linux operating system. then execute command "swapoff -a" (Yet to find out Solaris equivalent of this command) wait till swap memory used goes down to zero. Oct 11, 2018 · max semaphores system wide = 1024000000. If we want to hibernate, we definitely need a swap partition or file the size of our RAM or bigger. Feb 20, 2019 · @Melebius The 8G RAM came directly from their image. The swap space acts as an extension to the physical memory and allows the system to Jun 1, 2019 · Resize swap fallocate -l 1G /swapfile (change 1G to the gigabyte size you want it to be) CHMOD swap: chmod 600 /swapfile. Click the Advanced On Linux, you can use the pmap command to see all of the things mapped into the process space (from here on out I'm only going to refer to Linux, because it's what I use; I'm sure there are equivalent tools for Windows). Increase Physical Memory. Swap memory usage is at 100%. Once the above command completed successfully, issue the following command to re enable the swap. Average load. Clearing Dentries and Inodes. About this page This is a preview of a SAP Knowledge Base Article. oracle-11g-r2. The caches and buffers used by the kernel are also displayed. Another useful command is the free Mar 3, 2020 · When swap space is available, under low memory conditions, the oom-killer first tries to swap out as many pages as possible. Feb 20, 2020 · You begin by disabling the swap for the associated volume. Jun 20, 2022 · We have this alert: High swap space usage ( less than 20% free) for over 18 days for a Windows Server 2019 virtual machine. There are Sep 9, 2021 · 1. With the -h switch, the free command displays the memory and swap utilization in nearest possible, 3 digit format. Number of logged-in users. turn the swap off with something like: - sync. wslconfig. Make sure you have sufficient physical memory to hold the swap file contents, and then. Jun 5, 2022 · 1. 8G 3. Swappiness can be set to values between 0 and 100 inclusive. Answer. Dec 3, 2023 · To deactivate and delete the swap file, first, deactivate the swap space: sudo swapoff -v /swap. Mar 18, 2024 · As mentioned earlier, the swap is a space reserved for memory management. 0G Aug 15 12:47 /swapfile, indicating that now only root has the read and write flags enabled. Swap usage may slowly increase as shown above but should stop at some point. Type t to set the hex code 82 for a Linux swap partition. Aug 7, 2015 · To reduce the memory footprint, I've set the --single-process mode, which makes sense in cases like this. Active the swap file swapon /swapfile. then execute command "swapon -a". The system can now start utilizing the new, larger swap space. Swap partitions are designated as type 82 on MBR and 0657FD6D-A4AB-43C4-84E5-0933C84B4F4F on GPT. I even recommend adding more RAM and set swap to 0 in LXC guests. Finally, one can use the top or htop Nov 24, 2023 · Swap space is an allocated area on the hard disk that acts as virtual memory when physical RAM is exhausted. V. Sep 28, 2020 · Now verify that change using the same command as earlier: ls -lh /swapfile. Jan 8, 2024 · This command displays the active swap devices and their usage. Apply the change. But there can be I situation when almost all the swap is used (i. shmmax -> 16GB/4. Search for additional results Jun 24, 2020 · "I wanted to reduce swap and increase access to more RAM". Symptom. Any resemblance to real data is purely coincidental. To use free, just run the following: free -m. So I want to change the setting to. Refer to the corresponding operating system manual for exact instructions on managing swap space/partition. ) VIRT = SWAP + RES. With no swap activity, you may be able to reduce it. The heap size is constant for the application, but the swap space is being shooted up to 4gb within 6-7 days after deployment. Make file usable as swap mkswap /swapfile. With these steps, you can check, modify, and effectively clear swap memory in Linux without the need for a system reboot. If it is impossible to swap memory pages only when the server is idle, Swap should be tuned or disabled. Your RAM is always used entirely first before Linux starts using SWAP. Memory and swap usage statistics for processes. You can edit the ClamAV init script (int /etc/init. Feb 19, 2021 · 1. @MuhammadGelbana: your monitoring software should not count cached memory as used. With no swap, and RAM usage increasing, and disk/file butter/cache being reduced and reduced, and OOM trying its hardest to keep the machine running, it'll eventually run out of resources, with no where to go, and it'll hang/crash. , the getty instances when you only use X11, and some other inactive daemon). If those areas are requested again, they can be read back into RAM on demand. Check your available disks using the lsblk command. But I can't be sure what unit I have set. Jan 5, 2024 · sudo swapon /name. Dec 22, 2019 · Change or add this line to the file: vm. The swap tendancy is way to high in Linux Mint. Oct 23, 2023 · Memory management is therefore critical to maximise efficiency and optimise swap usage. The second pass swaps out pages to disk. But running systeminfo on powershell shows: Virtual Memory: Max Size: 32. It seems terrible, shmall and shmmax is bigger than my 16 GB. Now display the existing partitions on the hard drive. wslconfig ). Command: $ free -h. 970 MB. With that done, dedicate the file as swap space by entering: When running a desktop environment, disabling (unused) visual desktop effects may reduce GPU usage. A low value causes the kernel to avoid swapping, a higher value causes the kernel to try to use swap space. spuratic, Can you please explain how to reduce swap_usage memory in the system considering active and inactive memory. A node with 3 or more guests, if you see swap usage, that will slow down everything. conf in a terminal window. Sometimes it can be prudent to reduce swap space after installation. Issue. Preserve the Swap File. all code, data and shared libraries plus pages that have been. Dec 8, 2013 · My Task is to reduce used swap memory:- Solutions i have though of. swappiness=10. See full list on askubuntu. The swap space acts as an extension to the physical memory and allows the system to Jun 11, 2023 · If you are comfortable with the command line or are on a Linux server, use the following command: free -h. This will instruct the system to use swap memory only when RAM is used almost completely. You should fix your alerting software to monitor the actual thing that needs monitoring. In /proc/meminfo I can see the swap usage of the whole system like this: SwapCached: 4 kB SwapTotal: 33460220 kB SwapFree: 33460216 kB. Swap space usage becomes an issue only when there is not enough RAM available, and the kernel is forced to continuously move memory pages to swap and back to RAM, just to keep applications Sep 24, 2019 · You can use the free and ps commands to help diagnose any RAM issues, too. 3. Jan 27, 2012 · I get alert emails whenever swap usage is at 100%. For MySQL, remove innodb/bbdb if you do not use them, and remove PHP modules you do not need. Clearing PageCache. It will limit the possibility of ClamAV and you will probably swap which will probably slow down your whole system. Next, remove the swap file entry /swap. free -h. The output should have changed from rw-r--r-- 1 root root to -rw------- 1 root root 2. Verify the new swap file size. d/ to add the command ulimit -m amountofram. The easiest answer is: reduce your swap space (see how in this other question ). Consistently maxing out swap indicates it‘s way too small. “1 3″ reports for every 1 seconds a total of 3 times. (Note: you can define the STATSIZE=1 environment vari-. 5 GB of RAM + 1 GB of swap. Mar 27, 2020 · The free or top commands can tell you whether swap space is in use. Minimum requirements for constrained environments. To launch it, enter top in the terminal : top. Ubuntu ram usage. At a shell prompt, execute the following command to disable the swap file (where /swapfile is the swap file): Copy. At that point, yes, it may trigger a lot of writes which it is already doing as-is. 1. g. swappiness = 0 is the best way. We need to avoid swap. Number of running tasks. Type free -m to see both your ram and your swap space usage in Linux. How can I reduce swap usage without Aug 15, 2016 · How do I reduce the size of swap after accidentally enlarging it by 100GB? I imagine it would be via fdisk somehow. Thus, linux swaps memory to the disk. $ fdisk -l. We have two ways to tell the OS where this space is to be allocated. semaphore max value = 32767. Will the command free && sync &;& echo 3 > /proc/sys/vm/ Jul 19, 2021 · My laptop has crashed twice now before I started paying attention to memory usage. Next you should configure apache MaxClients based on the size of one process and the amount of memory you want to give apache. If you check for active swap again using swapon –show command, you won’t see any swap anymore. vanadium. Simple as that. Reducing the default value of swappiness will probably improve overall performance for a typical Ubuntu desktop installation. If the `fallocate` command is not available on your system, you can use dd instead: Apr 26, 2021 · The cron approach won't trigger though unless RAM usage is above the threshold. Under the "Performance" section, click the Settings button. You can tell WSL 2 how much RAM, swap space, CPU cores, and other resources it should allocate by creating a special . max ops per semop call = 500. You’ll notice that the “total” and “used” figures will be similar. The system displays information about: System uptime. Wait approximately 30 seconds for the system to complete the process, and then re-enable swap by entering: 1. able and the VIRT will be calculated from the /proc/#/state VmSize. Load average and run queue (sar -q) sar -q shows the run queue size and load average of last 1 minute, 5 minutes, and 15 minutes. You Nov 7, 2019 · 1. Because it harder to get files in and out of swap than it is to keep them. Mar 18, 2024 · While swap can be a partition or file, its main setting is the so-called swappiness. swappiness = 5. With Swap disabled, performance problems will become apparent very quickly and the OOM killer may catch you! :) For comparison, here is the output of an older version of free from procps-ng-3. You can check the size and current usage of swap space by running the command: grep SwapTotal /proc/meminfo. Reboot the system after saving the edited file. Moreover, generally, it is not recommended to disable swap completely - https://www Apr 3, 2023 · Not All Swap Usage is Bad¶ Installations containing disk partitions dedicated to swap can expand the amount of memory usable by the operating system. swappiness=100 tells the kernel to aggressively swap processes out of physical memory and move them to swap cache. It also does not answer how to reduce memory usage, but how to limit memory usage, which is a bit different. Procedure 15. – mattdm. – Mat. One way to do this is by using sudo nano /etc/sysctl. If you need to reduce the swap space for any reason, you simply change step 2 to look something like this: May 28, 2024 · The procedure to check swap space usage and size in Linux is as follows: Open a terminal application. Focus mode. How to Clear Swap Memory in Linux. The above instance has a 900 MiB swap volume attached and enabled. To clear the PageCache only, you can use the following command, which will specifically clear the PageCache, helping to free up memory resources. This command checks memory and swap utilization on your system in a few lines. The htop command is an alternative to top and provides a more user-friendly interface. Swap usage is at 100%; Swap is above threshold; Swap is higher than usual; Why is Swap being used while there is available memory? Environment. Copy. 1 on the same server. Open a terminal application. If you're using Aug 31, 2023 · The Linux top command shows the usage of the system's vital resources in real time. NAME TYPE SIZE USED PRIO. Aug 25, 2022 · By design Linux prefers to keep files in swap, even if they aren't used. Average: 14. You can also refer to the /proc/swaps file to see swap areas in use on Linux. The next important step is to preserve the newly created swap file. Oct 13, 2019 · The ‘free’ command shows the total amount of used and free swap and physical memory in the system. #3. Ares Aims for $750 Billion Assets Under Management. Click more to access the full version on SAP for Me (Login required). The Linux kernel will move to swap memory pages that are very seldom used (e. linux. You can also change the value while your system is still running with: sysctl vm. The most important thing to pay attention to is the “used 2. It is usually enabled by default, but you need to check. If --memory-swap is set to the same value as --memory, and --memory is set to a positive integer, the container doesn't have access to swap. Stop all java applications and wait till physical memory is sufficiently freed. A Red Hat training course is available for Red Hat Enterprise Linux. wslconfig file under your Windows user profile directory ( C:\Users\YourUsername\. This is particularly useful for users who want to optimize their system performance by resizing the swap file based on their system’s requirements. If you want a more human-readable format, just run the command below : free –human. Use top or htop to see swap space utilization in Linux. Nov 4, 2023 · If you see swap usage regularly reaching 50-70%, an increase is recommended. Nov 21, 2021 · Swap space must be taken out of use before changing it. Thats it! Some commands may take some time to be executed, just wait patiently for the commands to finish. To see swap size in Linux, type the command: swapon -s . If you don't see a swap volume listed with this command, you may need to enable swap space for the device. 511 MB. The command sudo fallocate -l 4G /swapfile (with an adjusted size) will overwrite your existing swapfile if you do not delete it first. Here's an excerpt from the memory map of the "Hello World" program; the entire memory map is over 100 lines long, and it's A Red Hat training course is available for Red Hat Enterprise Linux. Follow the steps below: 1. Generally, linux-zen is a good option. sudo sync; echo 1 > /proc/sys/vm/drop_caches. Jun 7, 2022 · Click the About page on the right side. Mar 28, 2024 · The top command is essential for monitoring CPU and memory usage on a per-process basis. Use the swap space to provide temporary storage for inactive processes and data, and prevent out-of-memory errors when physical memory is full. The intent is to make it not use a swap file or swap space at all when RAM usage is below the threshold: No swap == No disk writes -- "law of averages" type trade-off. 4. In Linux, memory management is performed through various algorithms and mechanisms. ) 15. 3M 100. Create . You can also clear your swap by running swapoff -a and then swapon -a as root instead of rebooting to achieve the same effect. On launch, WSL will read this file if it exists and configure itself accordingly. Add a comment. 9 GB, including its usage. An easier way is to disable all the active swap on your system like this: sudo swapoff -a. Without the use of any switch, the displayed output is printed in kilobytes. sar -w 1 3. Follow the steps below to add swap space on a CentOS 7 system. If you want to clear the 2GB of swap memory, you need to have more than 2GB free memory on the physical memory RAM. su pt kz vu kf km yh lp no bd