{"id":286,"date":"2020-09-14T15:13:39","date_gmt":"2020-09-14T14:13:39","guid":{"rendered":"http:\/\/qedevelopment.co.uk\/?p=286"},"modified":"2020-12-31T12:52:53","modified_gmt":"2020-12-31T12:52:53","slug":"out-of-ram-increase-a-meagre-swapfile-under-linux","status":"publish","type":"post","link":"https:\/\/qedevelopment.co.uk\/?p=286","title":{"rendered":"Out of RAM: Increase a meagre swapfile under Linux"},"content":{"rendered":"\n<p>Swap space is an area set aside for use in the event that physical RAM becomes full. On a Linux machine, when the system runs out of RAM inactive pages are moved to the Swap Space freeing up RAM.<\/p>\n\n\n\n<p>Whilst building a Yocto Image on an old machine with limited RAM I was getting repeated failures during the compilation of qtbase. Analysis of the kernel log revealed that there was a shortage of memory, and hence a need to increase the swap space.<\/p>\n\n\n\n<p>You can determine the current status of the swap space using the following command<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo swapon --show\nNAME      TYPE SIZE   USED PRIO\n\/swapfile file   2G 265.9M   -2<\/pre>\n\n\n\n<p>To increase the size of the swapfile, begin by disabling the swap space, and then remove the existing swapfile.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo swapoff \/swapfile<br>sudo rm \/swapfile<\/pre>\n\n\n\n<p>You can now create a new blank swapfile, set the permissions associated with it, and then re-enable the swap space.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo dd if=\/dev\/zero of=\/swapfile bs=1M count=8192\nsudo chmod 600 \/swapfile\nsudo mkswap \/swapfile\nsudo swapon \/swapfile<\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Swap space is an area set aside for use in the event that physical RAM becomes full. On a Linux machine, when the system runs out of RAM inactive pages are moved to the Swap Space freeing up RAM. Whilst building a Yocto Image on an old machine with limited RAM I was getting repeated &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/qedevelopment.co.uk\/?p=286\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Out of RAM: Increase a meagre swapfile under Linux&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[11,20],"tags":[22,21],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/qedevelopment.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/286"}],"collection":[{"href":"https:\/\/qedevelopment.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qedevelopment.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qedevelopment.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/qedevelopment.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=286"}],"version-history":[{"count":1,"href":"https:\/\/qedevelopment.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/286\/revisions"}],"predecessor-version":[{"id":287,"href":"https:\/\/qedevelopment.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/286\/revisions\/287"}],"wp:attachment":[{"href":"https:\/\/qedevelopment.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qedevelopment.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qedevelopment.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}