{"id":13828,"date":"2024-03-23T12:42:00","date_gmt":"2024-03-23T09:42:00","guid":{"rendered":"http:\/\/local.brightwhiz\/?p=13828"},"modified":"2024-05-25T12:37:56","modified_gmt":"2024-05-25T09:37:56","slug":"boosting-performance-adding-swap-space-on-ubuntu-22-04","status":"publish","type":"post","link":"http:\/\/local.brightwhiz\/boosting-performance-adding-swap-space-on-ubuntu-22-04\/","title":{"rendered":"Boosting Performance: Adding Swap Space on Ubuntu 22.04"},"content":{"rendered":"\n

Is your Ubuntu 22.04 system running low on memory? Adding swap space can alleviate memory constraints and enhance performance. In this tutorial, we’ll guide you through the process of adding swap space to your Ubuntu 22.04 system, ensuring smoother operation and improved resource management.<\/p>\n\n\n\n

Step 1: Check Current Swap Usage<\/h3>\n\n\n\n

Before adding swap space, it’s essential to check the current usage of swap on your system. You can use the free<\/code> command to display information about swap space:<\/p>\n\n\n\n

$ free -h<\/code><\/pre>\n\n\n\n

This command will show you the total swap space available and how much is currently in use.<\/p>\n\n\n\n

Step 2: Create a Swap File<\/h3>\n\n\n\n

To create a swap file, you can use the dd<\/code> command to allocate space for the file:<\/p>\n\n\n\n

$ sudo fallocate -l 2G \/swapfile<\/code><\/pre>\n\n\n\n

This command creates a 2GB swap file. Adjust the size as needed based on your system requirements.<\/p>\n\n\n\n

Step 3: Set Permissions and Make the File Usable as Swap<\/h3>\n\n\n\n

After creating the swap file, you need to set appropriate permissions and make it usable as swap:<\/p>\n\n\n\n

$ sudo chmod 600 \/swapfile\n$ sudo mkswap \/swapfile<\/code><\/pre>\n\n\n\n

Step 4: Enable the Swap File<\/h3>\n\n\n\n

Once the swap file is created and configured, you can enable it using the swapon<\/code> command:<\/p>\n\n\n\n

$ sudo swapon \/swapfile<\/code><\/pre>\n\n\n\n

Step 5: Make the Swap File Permanent<\/h3>\n\n\n\n

To ensure that the swap file is activated automatically at boot time, you need to add an entry for it in the \/etc\/fstab<\/code> file:<\/p>\n\n\n\n

echo '\/swapfile none swap sw 0 0' | sudo tee -a \/etc\/fstab<\/code><\/pre>\n\n\n\n

Step 6: Verify Swap Space<\/h3>\n\n\n\n

Finally, verify that the swap space has been successfully added to your system by checking the output of the free<\/code> command again:<\/p>\n\n\n\n

$ free -h<\/code><\/pre>\n\n\n\n

Conclusion<\/h3>\n\n\n\n

By following these steps, you can easily add swap space to your Ubuntu 22.04 system, improving performance and ensuring smooth operation even under heavy memory load. Whether you’re dealing with resource-intensive tasks or simply looking to optimize system performance, adding swap space is a valuable technique for enhancing your Ubuntu experience.<\/p>\n","protected":false},"excerpt":{"rendered":"

Is your Ubuntu 22.04 system running low on memory? Adding swap space can alleviate memory constraints and enhance performance. In this tutorial, we’ll guide you through the process of adding…<\/p>\n","protected":false},"author":1,"featured_media":13379,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,23,9,16,18],"tags":[193,354,433,449,573,591,598],"yoast_head":"\nHow to Add Swap Space on Ubuntu 22.04<\/title>\n<meta name=\"description\" content=\"Boost Ubuntu 22.04 performance: Learn how to add swap space for smoother operation and improved resource management\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/local.brightwhiz\/boosting-performance-adding-swap-space-on-ubuntu-22-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Add Swap Space on Ubuntu 22.04\" \/>\n<meta property=\"og:description\" content=\"Boost Ubuntu 22.04 performance: Learn how to add swap space for smoother operation and improved resource management\" \/>\n<meta property=\"og:url\" content=\"http:\/\/local.brightwhiz\/boosting-performance-adding-swap-space-on-ubuntu-22-04\/\" \/>\n<meta property=\"og:site_name\" content=\"Brightwhiz.com\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/brightwhiz\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-23T09:42:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-25T09:37:56+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2023\/10\/Windows-to-Linux-migration-penguin.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"680\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Michael Bright\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@brightwhizmag\" \/>\n<meta name=\"twitter:site\" content=\"@brightwhizmag\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Michael Bright\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/local.brightwhiz\/boosting-performance-adding-swap-space-on-ubuntu-22-04\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/local.brightwhiz\/boosting-performance-adding-swap-space-on-ubuntu-22-04\/\"},\"author\":{\"name\":\"Michael Bright\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32\"},\"headline\":\"Boosting Performance: Adding Swap Space on Ubuntu 22.04\",\"datePublished\":\"2024-03-23T09:42:00+00:00\",\"dateModified\":\"2024-05-25T09:37:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/local.brightwhiz\/boosting-performance-adding-swap-space-on-ubuntu-22-04\/\"},\"wordCount\":291,\"publisher\":{\"@id\":\"http:\/\/local.brightwhiz\/#organization\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/boosting-performance-adding-swap-space-on-ubuntu-22-04\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2023\/10\/Windows-to-Linux-migration-penguin.jpg\",\"keywords\":[\"DevOps\",\"Linux\",\"Optimization\",\"Performance\",\"Systems Administration\",\"Tools\",\"Ubuntu\"],\"articleSection\":[\"Articles\",\"Guides\",\"How To\",\"Technology\",\"Tools\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/local.brightwhiz\/boosting-performance-adding-swap-space-on-ubuntu-22-04\/\",\"url\":\"http:\/\/local.brightwhiz\/boosting-performance-adding-swap-space-on-ubuntu-22-04\/\",\"name\":\"How to Add Swap Space on Ubuntu 22.04\",\"isPartOf\":{\"@id\":\"http:\/\/local.brightwhiz\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/local.brightwhiz\/boosting-performance-adding-swap-space-on-ubuntu-22-04\/#primaryimage\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/boosting-performance-adding-swap-space-on-ubuntu-22-04\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2023\/10\/Windows-to-Linux-migration-penguin.jpg\",\"datePublished\":\"2024-03-23T09:42:00+00:00\",\"dateModified\":\"2024-05-25T09:37:56+00:00\",\"description\":\"Boost Ubuntu 22.04 performance: Learn how to add swap space for smoother operation and improved resource management\",\"breadcrumb\":{\"@id\":\"http:\/\/local.brightwhiz\/boosting-performance-adding-swap-space-on-ubuntu-22-04\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/local.brightwhiz\/boosting-performance-adding-swap-space-on-ubuntu-22-04\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/boosting-performance-adding-swap-space-on-ubuntu-22-04\/#primaryimage\",\"url\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2023\/10\/Windows-to-Linux-migration-penguin.jpg\",\"contentUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2023\/10\/Windows-to-Linux-migration-penguin.jpg\",\"width\":1280,\"height\":680,\"caption\":\"Windows to Linux migration\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/local.brightwhiz\/boosting-performance-adding-swap-space-on-ubuntu-22-04\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/local.brightwhiz\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Boosting Performance: Adding Swap Space on Ubuntu 22.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/local.brightwhiz\/#website\",\"url\":\"http:\/\/local.brightwhiz\/\",\"name\":\"Brightwhiz.com\",\"description\":\"Best Tech guides, Tutorials, and News\",\"publisher\":{\"@id\":\"http:\/\/local.brightwhiz\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/local.brightwhiz\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/local.brightwhiz\/#organization\",\"name\":\"Brightwhiz\",\"url\":\"http:\/\/local.brightwhiz\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png\",\"contentUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png\",\"width\":706,\"height\":135,\"caption\":\"Brightwhiz\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/brightwhiz\/\",\"https:\/\/x.com\/brightwhizmag\",\"https:\/\/instagram.com\/bright_whiz\/\",\"https:\/\/www.pinterest.com\/sobbayi\/\",\"https:\/\/www.youtube.com\/channel\/UC6sCdP_d_RiTIM7ErFT-PSQ\"]},{\"@type\":\"Person\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32\",\"name\":\"Michael Bright\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g\",\"caption\":\"Michael Bright\"},\"sameAs\":[\"https:\/\/sobbayi.com\"],\"url\":\"http:\/\/local.brightwhiz\/author\/sobbayiadmin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Add Swap Space on Ubuntu 22.04","description":"Boost Ubuntu 22.04 performance: Learn how to add swap space for smoother operation and improved resource management","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":"http:\/\/local.brightwhiz\/boosting-performance-adding-swap-space-on-ubuntu-22-04\/","og_locale":"en_US","og_type":"article","og_title":"How to Add Swap Space on Ubuntu 22.04","og_description":"Boost Ubuntu 22.04 performance: Learn how to add swap space for smoother operation and improved resource management","og_url":"http:\/\/local.brightwhiz\/boosting-performance-adding-swap-space-on-ubuntu-22-04\/","og_site_name":"Brightwhiz.com","article_publisher":"https:\/\/www.facebook.com\/brightwhiz\/","article_published_time":"2024-03-23T09:42:00+00:00","article_modified_time":"2024-05-25T09:37:56+00:00","og_image":[{"width":1280,"height":680,"url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2023\/10\/Windows-to-Linux-migration-penguin.jpg","type":"image\/jpeg"}],"author":"Michael Bright","twitter_card":"summary_large_image","twitter_creator":"@brightwhizmag","twitter_site":"@brightwhizmag","twitter_misc":{"Written by":"Michael Bright","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/local.brightwhiz\/boosting-performance-adding-swap-space-on-ubuntu-22-04\/#article","isPartOf":{"@id":"http:\/\/local.brightwhiz\/boosting-performance-adding-swap-space-on-ubuntu-22-04\/"},"author":{"name":"Michael Bright","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32"},"headline":"Boosting Performance: Adding Swap Space on Ubuntu 22.04","datePublished":"2024-03-23T09:42:00+00:00","dateModified":"2024-05-25T09:37:56+00:00","mainEntityOfPage":{"@id":"http:\/\/local.brightwhiz\/boosting-performance-adding-swap-space-on-ubuntu-22-04\/"},"wordCount":291,"publisher":{"@id":"http:\/\/local.brightwhiz\/#organization"},"image":{"@id":"http:\/\/local.brightwhiz\/boosting-performance-adding-swap-space-on-ubuntu-22-04\/#primaryimage"},"thumbnailUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2023\/10\/Windows-to-Linux-migration-penguin.jpg","keywords":["DevOps","Linux","Optimization","Performance","Systems Administration","Tools","Ubuntu"],"articleSection":["Articles","Guides","How To","Technology","Tools"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"http:\/\/local.brightwhiz\/boosting-performance-adding-swap-space-on-ubuntu-22-04\/","url":"http:\/\/local.brightwhiz\/boosting-performance-adding-swap-space-on-ubuntu-22-04\/","name":"How to Add Swap Space on Ubuntu 22.04","isPartOf":{"@id":"http:\/\/local.brightwhiz\/#website"},"primaryImageOfPage":{"@id":"http:\/\/local.brightwhiz\/boosting-performance-adding-swap-space-on-ubuntu-22-04\/#primaryimage"},"image":{"@id":"http:\/\/local.brightwhiz\/boosting-performance-adding-swap-space-on-ubuntu-22-04\/#primaryimage"},"thumbnailUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2023\/10\/Windows-to-Linux-migration-penguin.jpg","datePublished":"2024-03-23T09:42:00+00:00","dateModified":"2024-05-25T09:37:56+00:00","description":"Boost Ubuntu 22.04 performance: Learn how to add swap space for smoother operation and improved resource management","breadcrumb":{"@id":"http:\/\/local.brightwhiz\/boosting-performance-adding-swap-space-on-ubuntu-22-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/local.brightwhiz\/boosting-performance-adding-swap-space-on-ubuntu-22-04\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/boosting-performance-adding-swap-space-on-ubuntu-22-04\/#primaryimage","url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2023\/10\/Windows-to-Linux-migration-penguin.jpg","contentUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2023\/10\/Windows-to-Linux-migration-penguin.jpg","width":1280,"height":680,"caption":"Windows to Linux migration"},{"@type":"BreadcrumbList","@id":"http:\/\/local.brightwhiz\/boosting-performance-adding-swap-space-on-ubuntu-22-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/local.brightwhiz\/"},{"@type":"ListItem","position":2,"name":"Boosting Performance: Adding Swap Space on Ubuntu 22.04"}]},{"@type":"WebSite","@id":"http:\/\/local.brightwhiz\/#website","url":"http:\/\/local.brightwhiz\/","name":"Brightwhiz.com","description":"Best Tech guides, Tutorials, and News","publisher":{"@id":"http:\/\/local.brightwhiz\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/local.brightwhiz\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/local.brightwhiz\/#organization","name":"Brightwhiz","url":"http:\/\/local.brightwhiz\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/","url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png","contentUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png","width":706,"height":135,"caption":"Brightwhiz"},"image":{"@id":"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/brightwhiz\/","https:\/\/x.com\/brightwhizmag","https:\/\/instagram.com\/bright_whiz\/","https:\/\/www.pinterest.com\/sobbayi\/","https:\/\/www.youtube.com\/channel\/UC6sCdP_d_RiTIM7ErFT-PSQ"]},{"@type":"Person","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32","name":"Michael Bright","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/image\/","url":"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g","contentUrl":"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g","caption":"Michael Bright"},"sameAs":["https:\/\/sobbayi.com"],"url":"http:\/\/local.brightwhiz\/author\/sobbayiadmin\/"}]}},"_links":{"self":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts\/13828"}],"collection":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/comments?post=13828"}],"version-history":[{"count":1,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts\/13828\/revisions"}],"predecessor-version":[{"id":13829,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts\/13828\/revisions\/13829"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/media\/13379"}],"wp:attachment":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/media?parent=13828"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/categories?post=13828"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/tags?post=13828"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}