{"id":1594,"date":"2022-01-01T20:44:31","date_gmt":"2022-01-01T15:14:31","guid":{"rendered":"https:\/\/smarttech101.com\/?p=1594"},"modified":"2023-03-19T16:03:45","modified_gmt":"2023-03-19T10:33:45","slug":"what-is-swap-memory-in-linux-and-how-to-manage-it","status":"publish","type":"post","link":"https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/","title":{"rendered":"What Is Swap Memory in Linux and How to Manage It?"},"content":{"rendered":"\n<p>This article is all about swap memory in Linux &#8211; swap partition and swap file, what are they, and how to activate and deactivate them. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"table-of-contents\">Table of Contents<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#what-is-swap-memory-in-linux\">What Is Swap Memory in Linux?<\/a><\/li>\n\n\n\n<li><a href=\"#why-do-we-create-swap-memory-in-linux\">Why Do We Create Swap Memory in Linux?<\/a><\/li>\n\n\n\n<li><a href=\"#swap-partition-vs-swap-file\">Swap Partition vs Swap File<\/a><\/li>\n\n\n\n<li><a href=\"#how-to-check-swap-space-in-linux\">How to Check Swap Space in Linux?<\/a><\/li>\n\n\n\n<li><a href=\"#how-to-create-swap-partition-in-linux\">How to Create Swap Partition in Linux?<\/a><\/li>\n\n\n\n<li><a href=\"#how-to-create-swap-file-in-linux\">How to Create Swap File in Linux?<\/a><\/li>\n\n\n\n<li><a href=\"#how-to-delete-swap-file\">How to Delete Swap File?<\/a><\/li>\n\n\n\n<li><a href=\"#that-s-all\">That&#8217;s All<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-swap-memory-in-linux\">What Is Swap Memory in Linux?<\/h2>\n\n\n\n<p>Swap Memory is also known as Swap Space. It is a special memory on a hard disk (or SSD). Whenever your computer starts any new application, it uses a part of physical memory called Random Access Memory (RAM) for caching and other purposes.  But the RAM has very limited space compared to hard disks. So, the computer frequently tries to free up the RAM&#8217;s space by &#8220;swapping&#8221; it for the Swap Memory&#8217;s space. That means the computer will use some swap space for the application&#8217;s caching, etc. <\/p>\n\n\n\n<p>The sum of Swap Memory and Physical Memory is called Virtual Memory.<br><strong>Virtual Memory = Swap Memory + Physical Memory.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1280\" height=\"720\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/01\/swap_space.png?resize=1280%2C720&#038;ssl=1\" alt=\"Swapping between Swap Memory and Physical Memory\" class=\"wp-image-1605\" srcset=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/01\/swap_space.png?w=1280&amp;ssl=1 1280w, https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/01\/swap_space.png?resize=768%2C432&amp;ssl=1 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><figcaption class=\"wp-element-caption\">Figure: Swapping between Swap Memory and Physical Memory<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"why-do-we-create-swap-memory-in-linux\">Why Do We Create Swap Memory in Linux?<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>As said earlier, it frees up the the physical RAM. This is <strong>very useful when your computer runs out of RAM<\/strong>. Imagine a scenario where you are doing some research: you have opened lots of tabs in your browser, lots of Virtual Box Machines, and lots of other applications. And if your system runs of RAM, it will freeze and you will not have any other option except shutting down the computer using the power button. You will loose all your taks. But if your have enabled the Swap Memory, your computer will not freeze completely although it becomes slow. The speed at this moment will depend upon the speed of your hard disk. And if you are using SSDs instead of the hard disk, that will be even better. <\/li>\n\n\n\n<li>Swap Memory is also used for <strong>Hibernation<\/strong>. The hibernation is little different from the Sleep (also called Suspend in the Linux world). In Sleep, the RAM still has electricity flowing in it but in the hibernation, RAM is turned off completely and all the contents of it are saved in the Swap Memory of your hard disk.<\/li>\n<\/ol>\n\n\n\n<p>After describing the meaning and applications of swap memory, I will be talking about the types of swap memory &#8211; swap file and swap partition by elucidating the differences between them.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"swap-partition-vs-swap-file\">Swap Partition vs Swap File<\/h2>\n\n\n\n<p>There is no performance difference between the two. But still, there are some differences:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><th>Swap Partition<\/th><th>Swap File<\/th><\/tr><\/thead><tbody><tr><td>The swap partition is like any other partition on the hard disk.<\/td><td>The swap file is like any other file on an existing partition.<\/td><\/tr><tr><td>The swap partition is used solely for one purpose &#8211; swap memory<\/td><td>The partition on which the swap file resides can be used for other purposes as well.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Personally, I prefer swap files because I can change their size anytime but in the swap partitions, I will need to delete\/extend\/shrink partitions on the hard disk and that might lead to data loss.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-check-swap-space-in-linux\">How to Check Swap Space in Linux?<\/h2>\n\n\n\n<p>To check the swap space in Linux, you can use the memory command <strong>free:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~$ free --human<\/code><\/pre>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>               total        used        free      shared  buff\/cache   available\nMem:           6.7Gi       2.0Gi       484Mi        31Mi       4.2Gi       4.3Gi\nSwap:           14Gi       137Mi        14Gi<\/code><\/pre>\n\n\n\n<p>In the above command, the flag <code>--human<\/code> is used to print the output in human-readable form i.e. use GiB, MiB, etc. instead of bytes. <\/p>\n\n\n\n<p>Another command to check the swap space in Linux is the<strong> swapon<\/strong> command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~$ swapon --show<\/code><\/pre>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>NAME      TYPE  SIZE USED PRIO\n\/swapfile file 14.6G 206M   -2<\/code><\/pre>\n\n\n\n<p>The above talk was all about the introduction and application of swap memory. In the next few headings, I will talk about how to create one. You can create it during or after the installation of your Linux distribution. <\/p>\n\n\n\n<p><strong>Recommended Reading: <\/strong><a href=\"https:\/\/smarttech101.com\/how-to-install-arch-linux-and-support-graphics\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Install Arch Linux?<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-create-swap-partition-in-linux\">How to Create Swap Partition in Linux?<\/h2>\n\n\n\n<p>The following steps assume that your system is not using a special type of file system called <strong>btrfs.<\/strong> To check your file system types, use <strong>df<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~$ df --output=source,fstype\n\nFilesystem     Type\ndev            devtmpfs\nrun            tmpfs\n\/dev\/nvme0n1p5 ext4\ntmpfs          tmpfs\n\/dev\/nvme1n1p1 ext4\ntmpfs          tmpfs\ntmpfs          tmpfs<\/code><\/pre>\n\n\n\n<p><strong>1st Step: Partition your Hard Disk<\/strong>:<\/p>\n\n\n\n<p><strong>Note: <\/strong>Before your begin, please backup all the partitions on the hard disk and unmount them. And, if your hard disk also has your root partition, you will not be able to unmount this root partition. In that case, boot into Live CD\/USB of any Linux distribution and partition from there.<\/p>\n\n\n\n<p>To partition your disk, you can use one of the <strong>fdisk, parted, or cfdisk<\/strong>, or other tools. I will recommend the <strong>cfdisk<\/strong> because it is interactive, user-friendly, and hence easier.<\/p>\n\n\n\n<p>And don&#8217;t forget to set the Partition Type as  &#8220;<strong>Linux swap&#8221;.<\/strong><\/p>\n\n\n\n<p><strong>2nd Step: Make the partition into a swap partition using <strong>mkswap<\/strong><\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># mkswap \/dev\/swap_partition<\/code><\/pre>\n\n\n\n<p><strong>3rd Step:  Enable it using <strong>swapon<\/strong><\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># swapon \/dev\/swap_partition<\/code><\/pre>\n\n\n\n<p><strong>4th Step: Create a fstab entry to automatically mount the swap partition:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># nano \/etc\/fstab<\/code><\/pre>\n\n\n\n<p>The <a href=\"https:\/\/smarttech101.com\/how-to-create-fstab-entry-in-linux\/\" target=\"_blank\" rel=\"noreferrer noopener\">fstab file \/etc\/fstab<\/a> enables your computer to<a href=\"https:\/\/smarttech101.com\/how-to-mount-a-drive-in-linux\/\" target=\"_blank\" rel=\"noreferrer noopener\"> mount the partition<\/a> automatically during boot.<\/p>\n\n\n\n<p>Now, add the following line into the file<strong> at the end<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>UUID=filesystem_UUID none swap defaults 0 0<\/code><\/pre>\n\n\n\n<p>Here, in the above line, you need to replace filesystem_UUID with your own UUID. This UUID is an ID and it is unique and hence, your computer will use it to identify the partition. To find UUID, use <strong>ls -l \/dev\/disk\/by-uuid\/<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~$ ls -l \/dev\/disk\/by-uuid\/ \ntotal 0\nlrwxrwxrwx 1 root root 15 Dec 30 00:43 32BA-F9AF -&gt; ..\/..\/nvme0n1p1\nlrwxrwxrwx 1 root root 15 Dec 30 00:43 3EA6BDEFA6BDA833 -&gt; ..\/..\/nvme0n1p4\nlrwxrwxrwx 1 root root 10 Dec 31 20:47 9674C20374C1E5D9 -&gt; ..\/..\/sda1\nlrwxrwxrwx 1 root root 15 Dec 31 20:35 bd4da364-6f99-4859-8ca4-326c89e9b11f -&gt; ..\/..\/nvme1n1p1\nlrwxrwxrwx 1 root root 15 Dec 30 00:43 d2d9da75-f104-46c8-9ff9-8193f083f2ff -&gt; ..\/..\/nvme0n1p5<\/code><\/pre>\n\n\n\n<p>So, a good example of the fstab entry would be:<\/p>\n\n\n\n<pre id=\"block-4a63c137-b83f-4ffe-baf3-e01d75260d37\" class=\"wp-block-code\"><code>UUID=9674C20374C1E5D9 none swap defaults 0 0<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-create-swap-file-in-linux\">How to Create Swap File in Linux?<\/h2>\n\n\n\n<p><strong>1: Create a virtual partition<\/strong><\/p>\n\n\n\n<p>Virtual Partitions are actually a file. To create it you can use <strong>dd:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># dd if=\/dev\/zero of=SWAP-LOCATION bs=1M count=COUNT-SIZE status=progress<\/code><\/pre>\n\n\n\n<p>Where SWAP-LOCATION is the location of the swap file and COUNT-SIZE determines the size of the file.<\/p>\n\n\n\n<p>Size of the file = bs x COUNT-SIZE<\/p>\n\n\n\n<p>So, if bs=1M and COUNT-SIZE=15000, the swap file will be of 15000M i.e. 15GB approximately. <\/p>\n\n\n\n<p>Just like swap partition, a recommended size will be at least 1.5 times your RAM.<\/p>\n\n\n\n<p>A good example of the above command would be:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># dd if=\/dev\/zero of=\/swapfile bs=1M count=15000 status=progress<\/code><\/pre>\n\n\n\n<p><strong>2: Modify the read and write permissions of the file using the chmod command<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># chmod 600 \/swapfile<\/code><\/pre>\n\n\n\n<p>Now only the owner user (i.e. the root) will have read and write access to the file.<\/p>\n\n\n\n<p><strong>3: Just like Swap Partition, make this file into a swap file using <strong>mkswap<\/strong><\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># mkswap \/swapfile<\/code><\/pre>\n\n\n\n<p><strong>4:  Enable the file using <strong>swapon<\/strong><\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># swapon \/swapfile<\/code><\/pre>\n\n\n\n<p><strong>5: Create a fstab entry to automatically mount the swap file:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~$ nano \/etc\/fstab<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\/swapfile none swap defaults 0 0<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-delete-swap-file\">How to Delete Swap File?<\/h2>\n\n\n\n<p><strong>1<\/strong>.<strong> <\/strong>Deactivate it using <strong>swapoff<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># swapoff \/swapfile<\/code><\/pre>\n\n\n\n<p><strong>2.<\/strong> Remove the fstab line <code>\/swapfile none swap defaults 0 0<\/code> from \/<strong>etc\/fstab<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># nano \/etc\/fstab<\/code><\/pre>\n\n\n\n<p><strong>3<\/strong>. Finally, remove the swapfile:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># rm \/swapfile<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"that-s-all\">That&#8217;s All<\/h2>\n\n\n\n<p>That&#8217;s all folks. If there are some mistakes in the article or you would like to suggest something, feel free to point them out in the comment section below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article is all about swap memory &#8211; swap partition and swap file, what are they, and how to activate and deactivate them.<\/p>\n","protected":false},"author":2,"featured_media":1605,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[48],"tags":[25,26],"class_list":["post-1594","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux-desktop-tools","tag-arch-linux-installation","tag-installation"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>What Is Swap Memory in Linux and How to Manage It? | SmartTech101<\/title>\n<meta name=\"description\" content=\"This article is all about swap memory in Linux - swap partition and swap file, what are they, and how to activate and deactivate them.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What Is Swap Memory in Linux and How to Manage It? | SmartTech101\" \/>\n<meta property=\"og:description\" content=\"This article is all about swap memory in Linux - swap partition and swap file, what are they, and how to activate and deactivate them.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/\" \/>\n<meta property=\"og:site_name\" content=\"SmartTech101\" \/>\n<meta property=\"article:published_time\" content=\"2022-01-01T15:14:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-19T10:33:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/smarttech101.com\/wp-content\/uploads\/2022\/01\/swap_space.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Ajay\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ajay_yadav\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ajay\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/\"},\"author\":{\"name\":\"Ajay\",\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334\"},\"headline\":\"What Is Swap Memory in Linux and How to Manage It?\",\"datePublished\":\"2022-01-01T15:14:31+00:00\",\"dateModified\":\"2023-03-19T10:33:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/\"},\"wordCount\":1094,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633\"},\"image\":{\"@id\":\"https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/01\/swap_space.png?fit=1280%2C720&ssl=1\",\"keywords\":[\"Arch Linux Installation\",\"Installation\"],\"articleSection\":[\"Linux Desktop Tools\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/\",\"url\":\"https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/\",\"name\":\"What Is Swap Memory in Linux and How to Manage It? | SmartTech101\",\"isPartOf\":{\"@id\":\"https:\/\/smarttech101.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/01\/swap_space.png?fit=1280%2C720&ssl=1\",\"datePublished\":\"2022-01-01T15:14:31+00:00\",\"dateModified\":\"2023-03-19T10:33:45+00:00\",\"description\":\"This article is all about swap memory in Linux - swap partition and swap file, what are they, and how to activate and deactivate them.\",\"breadcrumb\":{\"@id\":\"https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/01\/swap_space.png?fit=1280%2C720&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/01\/swap_space.png?fit=1280%2C720&ssl=1\",\"width\":1280,\"height\":720},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/smarttech101.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What Is Swap Memory in Linux and How to Manage It?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/smarttech101.com\/#website\",\"url\":\"https:\/\/smarttech101.com\/\",\"name\":\"SmartTech101\",\"description\":\"Do Everything in Linux\",\"publisher\":{\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/smarttech101.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633\",\"name\":\"Ajay Yadav\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/09\/cropped-ST101_logo.png?fit=180%2C60&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/09\/cropped-ST101_logo.png?fit=180%2C60&ssl=1\",\"width\":180,\"height\":60,\"caption\":\"Ajay Yadav\"},\"logo\":{\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334\",\"name\":\"Ajay\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6eea348caae2173954765a7cdf6cd107?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6eea348caae2173954765a7cdf6cd107?s=96&d=mm&r=g\",\"caption\":\"Ajay\"},\"sameAs\":[\"https:\/\/x.com\/ajay_yadav\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What Is Swap Memory in Linux and How to Manage It? | SmartTech101","description":"This article is all about swap memory in Linux - swap partition and swap file, what are they, and how to activate and deactivate them.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/","og_locale":"en_US","og_type":"article","og_title":"What Is Swap Memory in Linux and How to Manage It? | SmartTech101","og_description":"This article is all about swap memory in Linux - swap partition and swap file, what are they, and how to activate and deactivate them.","og_url":"https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/","og_site_name":"SmartTech101","article_published_time":"2022-01-01T15:14:31+00:00","article_modified_time":"2023-03-19T10:33:45+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/smarttech101.com\/wp-content\/uploads\/2022\/01\/swap_space.png","type":"image\/png"}],"author":"Ajay","twitter_card":"summary_large_image","twitter_creator":"@ajay_yadav","twitter_misc":{"Written by":"Ajay","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/#article","isPartOf":{"@id":"https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/"},"author":{"name":"Ajay","@id":"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334"},"headline":"What Is Swap Memory in Linux and How to Manage It?","datePublished":"2022-01-01T15:14:31+00:00","dateModified":"2023-03-19T10:33:45+00:00","mainEntityOfPage":{"@id":"https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/"},"wordCount":1094,"commentCount":1,"publisher":{"@id":"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633"},"image":{"@id":"https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/01\/swap_space.png?fit=1280%2C720&ssl=1","keywords":["Arch Linux Installation","Installation"],"articleSection":["Linux Desktop Tools"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/","url":"https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/","name":"What Is Swap Memory in Linux and How to Manage It? | SmartTech101","isPartOf":{"@id":"https:\/\/smarttech101.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/#primaryimage"},"image":{"@id":"https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/01\/swap_space.png?fit=1280%2C720&ssl=1","datePublished":"2022-01-01T15:14:31+00:00","dateModified":"2023-03-19T10:33:45+00:00","description":"This article is all about swap memory in Linux - swap partition and swap file, what are they, and how to activate and deactivate them.","breadcrumb":{"@id":"https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/#primaryimage","url":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/01\/swap_space.png?fit=1280%2C720&ssl=1","contentUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/01\/swap_space.png?fit=1280%2C720&ssl=1","width":1280,"height":720},{"@type":"BreadcrumbList","@id":"https:\/\/smarttech101.com\/what-is-swap-memory-in-linux-and-how-to-manage-it\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/smarttech101.com\/"},{"@type":"ListItem","position":2,"name":"What Is Swap Memory in Linux and How to Manage It?"}]},{"@type":"WebSite","@id":"https:\/\/smarttech101.com\/#website","url":"https:\/\/smarttech101.com\/","name":"SmartTech101","description":"Do Everything in Linux","publisher":{"@id":"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/smarttech101.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633","name":"Ajay Yadav","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/smarttech101.com\/#\/schema\/person\/image\/","url":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/09\/cropped-ST101_logo.png?fit=180%2C60&ssl=1","contentUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/09\/cropped-ST101_logo.png?fit=180%2C60&ssl=1","width":180,"height":60,"caption":"Ajay Yadav"},"logo":{"@id":"https:\/\/smarttech101.com\/#\/schema\/person\/image\/"}},{"@type":"Person","@id":"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334","name":"Ajay","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/smarttech101.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6eea348caae2173954765a7cdf6cd107?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6eea348caae2173954765a7cdf6cd107?s=96&d=mm&r=g","caption":"Ajay"},"sameAs":["https:\/\/x.com\/ajay_yadav"]}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/01\/swap_space.png?fit=1280%2C720&ssl=1","_links":{"self":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts\/1594"}],"collection":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/comments?post=1594"}],"version-history":[{"count":5,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts\/1594\/revisions"}],"predecessor-version":[{"id":2560,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts\/1594\/revisions\/2560"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/media\/1605"}],"wp:attachment":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/media?parent=1594"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/categories?post=1594"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/tags?post=1594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}