Does it make sense to create swap partitions for new installations nowadways?












24















For a desktop installation in a new and shiny laptop (let's say 16gb ram and ssd hd), does it make sense to have a swap partition?










share|improve this question























  • On my laptop, I've got 8GB RAM (allocated 2 GB to tmpfs). I'm fine without a swap, until I launch a few VMs, or open hundreds of tabs in Chromium. This only happens if I'm careless. You should be fine with 16 GB of RAM and no swap.

    – Rob W
    May 24 '13 at 17:32
















24















For a desktop installation in a new and shiny laptop (let's say 16gb ram and ssd hd), does it make sense to have a swap partition?










share|improve this question























  • On my laptop, I've got 8GB RAM (allocated 2 GB to tmpfs). I'm fine without a swap, until I launch a few VMs, or open hundreds of tabs in Chromium. This only happens if I'm careless. You should be fine with 16 GB of RAM and no swap.

    – Rob W
    May 24 '13 at 17:32














24












24








24


5






For a desktop installation in a new and shiny laptop (let's say 16gb ram and ssd hd), does it make sense to have a swap partition?










share|improve this question














For a desktop installation in a new and shiny laptop (let's say 16gb ram and ssd hd), does it make sense to have a swap partition?







laptop swap






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked May 24 '13 at 9:23









Frey OlakeFrey Olake

123115




123115













  • On my laptop, I've got 8GB RAM (allocated 2 GB to tmpfs). I'm fine without a swap, until I launch a few VMs, or open hundreds of tabs in Chromium. This only happens if I'm careless. You should be fine with 16 GB of RAM and no swap.

    – Rob W
    May 24 '13 at 17:32



















  • On my laptop, I've got 8GB RAM (allocated 2 GB to tmpfs). I'm fine without a swap, until I launch a few VMs, or open hundreds of tabs in Chromium. This only happens if I'm careless. You should be fine with 16 GB of RAM and no swap.

    – Rob W
    May 24 '13 at 17:32

















On my laptop, I've got 8GB RAM (allocated 2 GB to tmpfs). I'm fine without a swap, until I launch a few VMs, or open hundreds of tabs in Chromium. This only happens if I'm careless. You should be fine with 16 GB of RAM and no swap.

– Rob W
May 24 '13 at 17:32





On my laptop, I've got 8GB RAM (allocated 2 GB to tmpfs). I'm fine without a swap, until I launch a few VMs, or open hundreds of tabs in Chromium. This only happens if I'm careless. You should be fine with 16 GB of RAM and no swap.

– Rob W
May 24 '13 at 17:32










5 Answers
5






active

oldest

votes


















15















Yes you need swap, if you just use it for suspend and minor swap actions a swap file somewhere on your disk might be fine, And i been using swap file from almost a year never ever had problem with it, just don't like partitioning the disk.




Just copy paste the following line in terminal and it will create 2 GB of swap. First become root:



sudo su


Then copy and paste pate the following (as always, make sure you understand what you are pasting on your terminal):



mkdir /swap && 
cd /swap &&
fallocate -l 2g 2GB.swap &&
mkswap 2GB.swap &&
swapon 2GB.swap &&
echo "# # # Swap File # # #" >> /etc/fstab &&
echo "/swap/2GB.swap none swap sw 0 0" >> /etc/fstab &&
mount -a


Swap (partition vs file) for performance



Down Side



You cannot hibernate to swap file, as mentioned by @Takkat, I have check and i have 1st time in my life try to hibernate but its not working, so if you want to hibernate yo need swap partition, otherwise if swap file is good to go.



Hibernate vs. Suspend






share|improve this answer


























  • (((( suspend )))))

    – Qasim
    May 24 '13 at 11:12











  • I've never hibernated, always suspend so I think I'm gonna use your advice to have swap in a file. Probably just a script for times when I could use all ram available

    – Frey Olake
    May 24 '13 at 11:27











  • I am able to suspend without a swap partition or a swap file.

    – Kris Harper
    May 24 '13 at 14:14











  • @KrisHarper yes you can ....howtogeek.com/113923/how-to-re-enable-hibernate-in-ubuntu-12.04 its good to have something for swap..

    – Qasim
    May 24 '13 at 14:23













  • I'm saying that I don't think you need a swap file or swap space if you just use suspend. You definitely need it for hibernate, but I can use suspend just fine without it.

    – Kris Harper
    May 24 '13 at 14:51



















12














If you want to be able to hibernate, then yes, it is necessary to have a swap partition at least as large as your total RAM.



Apart from that, if you have 16GB of RAM then in principle probably not - I've seen people saying that 1GB is plenty to run without swap, though I imagine it would boil down to a matter of opinion for many people. In my case, I'm running a laptop with 8GB RAM and have a swap the same size for hibernation purposes (with the side-effect that it provides a buffer if my work becomes particularly memory-intensive, as it can do sometimes)






share|improve this answer



















  • 4





    I always keep at least some swap even on my 12GB machine. Running solely on memory is never advisable under any circumstances. And you'll be glad you spared some swap when you're at 99% memory usage and about to kernel panic :p (on a more serious note, it's good for paging out programs that are in standby, giving you more working memory in exchange for hard drive space which is always a good deal)

    – Thomas
    May 24 '13 at 15:02



















3














Is this a theoretical question or a practical one?



In practice, there's almost no reason to avoid a swap partition because disk space is cheap and plentiful (especially on shiny new laptops).



On paper, it might seem that 16GB of memory will never be used up. Consider these circumstances:




  • certain programs (e.g. video editors, LibreOffice) use an exorbitant amount of pages when starting up for initialization, then never used again

  • unforeseen circumstances: a program going crazy, a fork bomb


Now consider them happening at the same time. A swap partition will serve as a buffer when unpredictable events line up, buying you some time before the system crashes to save work, etc.



Specifically because have a laptop, there will come a time when hibernation saves your skin. Perhaps you will leave your computer for a coffee break, but something comes up and you, instead, return an hour later. If your battery picks that moment to die, hibernation will protect your unsaved work.






share|improve this answer































    0














    Well, for over a year I have not partitioned my SSD and also have no swap file. I have been using the same SSD (512 GB) in two different notebooks. The older one had 8GB RAM, the newer has 16 GB. I use the RAM for temporary files and Firefox Cache and with the 8 GB I sometimes noticed the system getting slow when syncing huge files with grsync. Now with 16 GB RAM (and maybe also newer Ubuntu version 13.04) I have not encountered any problems whatsoever. Also I believe that partitioning is not good for SSDs and is a way of wasting expensive storage.
    So I only can speak from my experience with SSD/16GB RAM: with this constellation I would certainly not use SWAP and even with 8GB RAM I was ok. Hibernation has been buggy anyway and Standby is much faster






    share|improve this answer































      0














      You can make a swap file instead and hibernate with it too, I have made swap files on my laptop so I can hibernate each of my linux installations. Otherwise hibernate would just overwrite the last hibernation if I was using one swap partition. This is my method. Notice you must hibernate using the kernel method: echo disk > /sys/power/state



      sudo -s 
      fallocate -l 4000m /swap_file #4000 mb, may want higher than 4000mb
      swapoff -a

      mkswap /swap_file

      nano /etc/fstab
      #delete previous swap entry then add
      /swap_file swap swap defaults 0 0
      #then save and exit

      swap-offset /swap_file #remember the output of this
      nano /etc/grub.d/40_custom
      add to linux line: resume=<partition swapfile is on> resume_offset=<swap-offset return data>

      swapon -a
      nano /home/name/bin/hibernate_shutdown
      #!/bin/bash
      echo shutdown > /sys/power/disk
      echo disk > /sys/power/state

      create shortcut. system-settings->keyboard->shortcuts->custom shortcuts add
      gnomesu /home/name/bin/hibernate_shutdown
      set to F11
      chmod +x /home/name/bin/hibernate_shutdown
      restart computer


      viola
      if you want to restart after hibernate instead of shutdown



      echo reboot > /sys/power/disk
      echo disk > /sys/power/state





      share|improve this answer























        Your Answer








        StackExchange.ready(function() {
        var channelOptions = {
        tags: "".split(" "),
        id: "89"
        };
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function() {
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled) {
        StackExchange.using("snippets", function() {
        createEditor();
        });
        }
        else {
        createEditor();
        }
        });

        function createEditor() {
        StackExchange.prepareEditor({
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader: {
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        },
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        });


        }
        });














        draft saved

        draft discarded


















        StackExchange.ready(
        function () {
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f299417%2fdoes-it-make-sense-to-create-swap-partitions-for-new-installations-nowadways%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        5 Answers
        5






        active

        oldest

        votes








        5 Answers
        5






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        15















        Yes you need swap, if you just use it for suspend and minor swap actions a swap file somewhere on your disk might be fine, And i been using swap file from almost a year never ever had problem with it, just don't like partitioning the disk.




        Just copy paste the following line in terminal and it will create 2 GB of swap. First become root:



        sudo su


        Then copy and paste pate the following (as always, make sure you understand what you are pasting on your terminal):



        mkdir /swap && 
        cd /swap &&
        fallocate -l 2g 2GB.swap &&
        mkswap 2GB.swap &&
        swapon 2GB.swap &&
        echo "# # # Swap File # # #" >> /etc/fstab &&
        echo "/swap/2GB.swap none swap sw 0 0" >> /etc/fstab &&
        mount -a


        Swap (partition vs file) for performance



        Down Side



        You cannot hibernate to swap file, as mentioned by @Takkat, I have check and i have 1st time in my life try to hibernate but its not working, so if you want to hibernate yo need swap partition, otherwise if swap file is good to go.



        Hibernate vs. Suspend






        share|improve this answer


























        • (((( suspend )))))

          – Qasim
          May 24 '13 at 11:12











        • I've never hibernated, always suspend so I think I'm gonna use your advice to have swap in a file. Probably just a script for times when I could use all ram available

          – Frey Olake
          May 24 '13 at 11:27











        • I am able to suspend without a swap partition or a swap file.

          – Kris Harper
          May 24 '13 at 14:14











        • @KrisHarper yes you can ....howtogeek.com/113923/how-to-re-enable-hibernate-in-ubuntu-12.04 its good to have something for swap..

          – Qasim
          May 24 '13 at 14:23













        • I'm saying that I don't think you need a swap file or swap space if you just use suspend. You definitely need it for hibernate, but I can use suspend just fine without it.

          – Kris Harper
          May 24 '13 at 14:51
















        15















        Yes you need swap, if you just use it for suspend and minor swap actions a swap file somewhere on your disk might be fine, And i been using swap file from almost a year never ever had problem with it, just don't like partitioning the disk.




        Just copy paste the following line in terminal and it will create 2 GB of swap. First become root:



        sudo su


        Then copy and paste pate the following (as always, make sure you understand what you are pasting on your terminal):



        mkdir /swap && 
        cd /swap &&
        fallocate -l 2g 2GB.swap &&
        mkswap 2GB.swap &&
        swapon 2GB.swap &&
        echo "# # # Swap File # # #" >> /etc/fstab &&
        echo "/swap/2GB.swap none swap sw 0 0" >> /etc/fstab &&
        mount -a


        Swap (partition vs file) for performance



        Down Side



        You cannot hibernate to swap file, as mentioned by @Takkat, I have check and i have 1st time in my life try to hibernate but its not working, so if you want to hibernate yo need swap partition, otherwise if swap file is good to go.



        Hibernate vs. Suspend






        share|improve this answer


























        • (((( suspend )))))

          – Qasim
          May 24 '13 at 11:12











        • I've never hibernated, always suspend so I think I'm gonna use your advice to have swap in a file. Probably just a script for times when I could use all ram available

          – Frey Olake
          May 24 '13 at 11:27











        • I am able to suspend without a swap partition or a swap file.

          – Kris Harper
          May 24 '13 at 14:14











        • @KrisHarper yes you can ....howtogeek.com/113923/how-to-re-enable-hibernate-in-ubuntu-12.04 its good to have something for swap..

          – Qasim
          May 24 '13 at 14:23













        • I'm saying that I don't think you need a swap file or swap space if you just use suspend. You definitely need it for hibernate, but I can use suspend just fine without it.

          – Kris Harper
          May 24 '13 at 14:51














        15












        15








        15








        Yes you need swap, if you just use it for suspend and minor swap actions a swap file somewhere on your disk might be fine, And i been using swap file from almost a year never ever had problem with it, just don't like partitioning the disk.




        Just copy paste the following line in terminal and it will create 2 GB of swap. First become root:



        sudo su


        Then copy and paste pate the following (as always, make sure you understand what you are pasting on your terminal):



        mkdir /swap && 
        cd /swap &&
        fallocate -l 2g 2GB.swap &&
        mkswap 2GB.swap &&
        swapon 2GB.swap &&
        echo "# # # Swap File # # #" >> /etc/fstab &&
        echo "/swap/2GB.swap none swap sw 0 0" >> /etc/fstab &&
        mount -a


        Swap (partition vs file) for performance



        Down Side



        You cannot hibernate to swap file, as mentioned by @Takkat, I have check and i have 1st time in my life try to hibernate but its not working, so if you want to hibernate yo need swap partition, otherwise if swap file is good to go.



        Hibernate vs. Suspend






        share|improve this answer
















        Yes you need swap, if you just use it for suspend and minor swap actions a swap file somewhere on your disk might be fine, And i been using swap file from almost a year never ever had problem with it, just don't like partitioning the disk.




        Just copy paste the following line in terminal and it will create 2 GB of swap. First become root:



        sudo su


        Then copy and paste pate the following (as always, make sure you understand what you are pasting on your terminal):



        mkdir /swap && 
        cd /swap &&
        fallocate -l 2g 2GB.swap &&
        mkswap 2GB.swap &&
        swapon 2GB.swap &&
        echo "# # # Swap File # # #" >> /etc/fstab &&
        echo "/swap/2GB.swap none swap sw 0 0" >> /etc/fstab &&
        mount -a


        Swap (partition vs file) for performance



        Down Side



        You cannot hibernate to swap file, as mentioned by @Takkat, I have check and i have 1st time in my life try to hibernate but its not working, so if you want to hibernate yo need swap partition, otherwise if swap file is good to go.



        Hibernate vs. Suspend







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jan 20 at 15:52









        Pablo Bianchi

        2,4651531




        2,4651531










        answered May 24 '13 at 10:37









        QasimQasim

        17.7k185984




        17.7k185984













        • (((( suspend )))))

          – Qasim
          May 24 '13 at 11:12











        • I've never hibernated, always suspend so I think I'm gonna use your advice to have swap in a file. Probably just a script for times when I could use all ram available

          – Frey Olake
          May 24 '13 at 11:27











        • I am able to suspend without a swap partition or a swap file.

          – Kris Harper
          May 24 '13 at 14:14











        • @KrisHarper yes you can ....howtogeek.com/113923/how-to-re-enable-hibernate-in-ubuntu-12.04 its good to have something for swap..

          – Qasim
          May 24 '13 at 14:23













        • I'm saying that I don't think you need a swap file or swap space if you just use suspend. You definitely need it for hibernate, but I can use suspend just fine without it.

          – Kris Harper
          May 24 '13 at 14:51



















        • (((( suspend )))))

          – Qasim
          May 24 '13 at 11:12











        • I've never hibernated, always suspend so I think I'm gonna use your advice to have swap in a file. Probably just a script for times when I could use all ram available

          – Frey Olake
          May 24 '13 at 11:27











        • I am able to suspend without a swap partition or a swap file.

          – Kris Harper
          May 24 '13 at 14:14











        • @KrisHarper yes you can ....howtogeek.com/113923/how-to-re-enable-hibernate-in-ubuntu-12.04 its good to have something for swap..

          – Qasim
          May 24 '13 at 14:23













        • I'm saying that I don't think you need a swap file or swap space if you just use suspend. You definitely need it for hibernate, but I can use suspend just fine without it.

          – Kris Harper
          May 24 '13 at 14:51

















        (((( suspend )))))

        – Qasim
        May 24 '13 at 11:12





        (((( suspend )))))

        – Qasim
        May 24 '13 at 11:12













        I've never hibernated, always suspend so I think I'm gonna use your advice to have swap in a file. Probably just a script for times when I could use all ram available

        – Frey Olake
        May 24 '13 at 11:27





        I've never hibernated, always suspend so I think I'm gonna use your advice to have swap in a file. Probably just a script for times when I could use all ram available

        – Frey Olake
        May 24 '13 at 11:27













        I am able to suspend without a swap partition or a swap file.

        – Kris Harper
        May 24 '13 at 14:14





        I am able to suspend without a swap partition or a swap file.

        – Kris Harper
        May 24 '13 at 14:14













        @KrisHarper yes you can ....howtogeek.com/113923/how-to-re-enable-hibernate-in-ubuntu-12.04 its good to have something for swap..

        – Qasim
        May 24 '13 at 14:23







        @KrisHarper yes you can ....howtogeek.com/113923/how-to-re-enable-hibernate-in-ubuntu-12.04 its good to have something for swap..

        – Qasim
        May 24 '13 at 14:23















        I'm saying that I don't think you need a swap file or swap space if you just use suspend. You definitely need it for hibernate, but I can use suspend just fine without it.

        – Kris Harper
        May 24 '13 at 14:51





        I'm saying that I don't think you need a swap file or swap space if you just use suspend. You definitely need it for hibernate, but I can use suspend just fine without it.

        – Kris Harper
        May 24 '13 at 14:51













        12














        If you want to be able to hibernate, then yes, it is necessary to have a swap partition at least as large as your total RAM.



        Apart from that, if you have 16GB of RAM then in principle probably not - I've seen people saying that 1GB is plenty to run without swap, though I imagine it would boil down to a matter of opinion for many people. In my case, I'm running a laptop with 8GB RAM and have a swap the same size for hibernation purposes (with the side-effect that it provides a buffer if my work becomes particularly memory-intensive, as it can do sometimes)






        share|improve this answer



















        • 4





          I always keep at least some swap even on my 12GB machine. Running solely on memory is never advisable under any circumstances. And you'll be glad you spared some swap when you're at 99% memory usage and about to kernel panic :p (on a more serious note, it's good for paging out programs that are in standby, giving you more working memory in exchange for hard drive space which is always a good deal)

          – Thomas
          May 24 '13 at 15:02
















        12














        If you want to be able to hibernate, then yes, it is necessary to have a swap partition at least as large as your total RAM.



        Apart from that, if you have 16GB of RAM then in principle probably not - I've seen people saying that 1GB is plenty to run without swap, though I imagine it would boil down to a matter of opinion for many people. In my case, I'm running a laptop with 8GB RAM and have a swap the same size for hibernation purposes (with the side-effect that it provides a buffer if my work becomes particularly memory-intensive, as it can do sometimes)






        share|improve this answer



















        • 4





          I always keep at least some swap even on my 12GB machine. Running solely on memory is never advisable under any circumstances. And you'll be glad you spared some swap when you're at 99% memory usage and about to kernel panic :p (on a more serious note, it's good for paging out programs that are in standby, giving you more working memory in exchange for hard drive space which is always a good deal)

          – Thomas
          May 24 '13 at 15:02














        12












        12








        12







        If you want to be able to hibernate, then yes, it is necessary to have a swap partition at least as large as your total RAM.



        Apart from that, if you have 16GB of RAM then in principle probably not - I've seen people saying that 1GB is plenty to run without swap, though I imagine it would boil down to a matter of opinion for many people. In my case, I'm running a laptop with 8GB RAM and have a swap the same size for hibernation purposes (with the side-effect that it provides a buffer if my work becomes particularly memory-intensive, as it can do sometimes)






        share|improve this answer













        If you want to be able to hibernate, then yes, it is necessary to have a swap partition at least as large as your total RAM.



        Apart from that, if you have 16GB of RAM then in principle probably not - I've seen people saying that 1GB is plenty to run without swap, though I imagine it would boil down to a matter of opinion for many people. In my case, I'm running a laptop with 8GB RAM and have a swap the same size for hibernation purposes (with the side-effect that it provides a buffer if my work becomes particularly memory-intensive, as it can do sometimes)







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered May 24 '13 at 9:29









        Jez WJez W

        1,7701026




        1,7701026








        • 4





          I always keep at least some swap even on my 12GB machine. Running solely on memory is never advisable under any circumstances. And you'll be glad you spared some swap when you're at 99% memory usage and about to kernel panic :p (on a more serious note, it's good for paging out programs that are in standby, giving you more working memory in exchange for hard drive space which is always a good deal)

          – Thomas
          May 24 '13 at 15:02














        • 4





          I always keep at least some swap even on my 12GB machine. Running solely on memory is never advisable under any circumstances. And you'll be glad you spared some swap when you're at 99% memory usage and about to kernel panic :p (on a more serious note, it's good for paging out programs that are in standby, giving you more working memory in exchange for hard drive space which is always a good deal)

          – Thomas
          May 24 '13 at 15:02








        4




        4





        I always keep at least some swap even on my 12GB machine. Running solely on memory is never advisable under any circumstances. And you'll be glad you spared some swap when you're at 99% memory usage and about to kernel panic :p (on a more serious note, it's good for paging out programs that are in standby, giving you more working memory in exchange for hard drive space which is always a good deal)

        – Thomas
        May 24 '13 at 15:02





        I always keep at least some swap even on my 12GB machine. Running solely on memory is never advisable under any circumstances. And you'll be glad you spared some swap when you're at 99% memory usage and about to kernel panic :p (on a more serious note, it's good for paging out programs that are in standby, giving you more working memory in exchange for hard drive space which is always a good deal)

        – Thomas
        May 24 '13 at 15:02











        3














        Is this a theoretical question or a practical one?



        In practice, there's almost no reason to avoid a swap partition because disk space is cheap and plentiful (especially on shiny new laptops).



        On paper, it might seem that 16GB of memory will never be used up. Consider these circumstances:




        • certain programs (e.g. video editors, LibreOffice) use an exorbitant amount of pages when starting up for initialization, then never used again

        • unforeseen circumstances: a program going crazy, a fork bomb


        Now consider them happening at the same time. A swap partition will serve as a buffer when unpredictable events line up, buying you some time before the system crashes to save work, etc.



        Specifically because have a laptop, there will come a time when hibernation saves your skin. Perhaps you will leave your computer for a coffee break, but something comes up and you, instead, return an hour later. If your battery picks that moment to die, hibernation will protect your unsaved work.






        share|improve this answer




























          3














          Is this a theoretical question or a practical one?



          In practice, there's almost no reason to avoid a swap partition because disk space is cheap and plentiful (especially on shiny new laptops).



          On paper, it might seem that 16GB of memory will never be used up. Consider these circumstances:




          • certain programs (e.g. video editors, LibreOffice) use an exorbitant amount of pages when starting up for initialization, then never used again

          • unforeseen circumstances: a program going crazy, a fork bomb


          Now consider them happening at the same time. A swap partition will serve as a buffer when unpredictable events line up, buying you some time before the system crashes to save work, etc.



          Specifically because have a laptop, there will come a time when hibernation saves your skin. Perhaps you will leave your computer for a coffee break, but something comes up and you, instead, return an hour later. If your battery picks that moment to die, hibernation will protect your unsaved work.






          share|improve this answer


























            3












            3








            3







            Is this a theoretical question or a practical one?



            In practice, there's almost no reason to avoid a swap partition because disk space is cheap and plentiful (especially on shiny new laptops).



            On paper, it might seem that 16GB of memory will never be used up. Consider these circumstances:




            • certain programs (e.g. video editors, LibreOffice) use an exorbitant amount of pages when starting up for initialization, then never used again

            • unforeseen circumstances: a program going crazy, a fork bomb


            Now consider them happening at the same time. A swap partition will serve as a buffer when unpredictable events line up, buying you some time before the system crashes to save work, etc.



            Specifically because have a laptop, there will come a time when hibernation saves your skin. Perhaps you will leave your computer for a coffee break, but something comes up and you, instead, return an hour later. If your battery picks that moment to die, hibernation will protect your unsaved work.






            share|improve this answer













            Is this a theoretical question or a practical one?



            In practice, there's almost no reason to avoid a swap partition because disk space is cheap and plentiful (especially on shiny new laptops).



            On paper, it might seem that 16GB of memory will never be used up. Consider these circumstances:




            • certain programs (e.g. video editors, LibreOffice) use an exorbitant amount of pages when starting up for initialization, then never used again

            • unforeseen circumstances: a program going crazy, a fork bomb


            Now consider them happening at the same time. A swap partition will serve as a buffer when unpredictable events line up, buying you some time before the system crashes to save work, etc.



            Specifically because have a laptop, there will come a time when hibernation saves your skin. Perhaps you will leave your computer for a coffee break, but something comes up and you, instead, return an hour later. If your battery picks that moment to die, hibernation will protect your unsaved work.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered May 28 '13 at 2:14









            xekyuxekyu

            312




            312























                0














                Well, for over a year I have not partitioned my SSD and also have no swap file. I have been using the same SSD (512 GB) in two different notebooks. The older one had 8GB RAM, the newer has 16 GB. I use the RAM for temporary files and Firefox Cache and with the 8 GB I sometimes noticed the system getting slow when syncing huge files with grsync. Now with 16 GB RAM (and maybe also newer Ubuntu version 13.04) I have not encountered any problems whatsoever. Also I believe that partitioning is not good for SSDs and is a way of wasting expensive storage.
                So I only can speak from my experience with SSD/16GB RAM: with this constellation I would certainly not use SWAP and even with 8GB RAM I was ok. Hibernation has been buggy anyway and Standby is much faster






                share|improve this answer




























                  0














                  Well, for over a year I have not partitioned my SSD and also have no swap file. I have been using the same SSD (512 GB) in two different notebooks. The older one had 8GB RAM, the newer has 16 GB. I use the RAM for temporary files and Firefox Cache and with the 8 GB I sometimes noticed the system getting slow when syncing huge files with grsync. Now with 16 GB RAM (and maybe also newer Ubuntu version 13.04) I have not encountered any problems whatsoever. Also I believe that partitioning is not good for SSDs and is a way of wasting expensive storage.
                  So I only can speak from my experience with SSD/16GB RAM: with this constellation I would certainly not use SWAP and even with 8GB RAM I was ok. Hibernation has been buggy anyway and Standby is much faster






                  share|improve this answer


























                    0












                    0








                    0







                    Well, for over a year I have not partitioned my SSD and also have no swap file. I have been using the same SSD (512 GB) in two different notebooks. The older one had 8GB RAM, the newer has 16 GB. I use the RAM for temporary files and Firefox Cache and with the 8 GB I sometimes noticed the system getting slow when syncing huge files with grsync. Now with 16 GB RAM (and maybe also newer Ubuntu version 13.04) I have not encountered any problems whatsoever. Also I believe that partitioning is not good for SSDs and is a way of wasting expensive storage.
                    So I only can speak from my experience with SSD/16GB RAM: with this constellation I would certainly not use SWAP and even with 8GB RAM I was ok. Hibernation has been buggy anyway and Standby is much faster






                    share|improve this answer













                    Well, for over a year I have not partitioned my SSD and also have no swap file. I have been using the same SSD (512 GB) in two different notebooks. The older one had 8GB RAM, the newer has 16 GB. I use the RAM for temporary files and Firefox Cache and with the 8 GB I sometimes noticed the system getting slow when syncing huge files with grsync. Now with 16 GB RAM (and maybe also newer Ubuntu version 13.04) I have not encountered any problems whatsoever. Also I believe that partitioning is not good for SSDs and is a way of wasting expensive storage.
                    So I only can speak from my experience with SSD/16GB RAM: with this constellation I would certainly not use SWAP and even with 8GB RAM I was ok. Hibernation has been buggy anyway and Standby is much faster







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered May 28 '13 at 23:44









                    ConsumologyConsumology

                    331413




                    331413























                        0














                        You can make a swap file instead and hibernate with it too, I have made swap files on my laptop so I can hibernate each of my linux installations. Otherwise hibernate would just overwrite the last hibernation if I was using one swap partition. This is my method. Notice you must hibernate using the kernel method: echo disk > /sys/power/state



                        sudo -s 
                        fallocate -l 4000m /swap_file #4000 mb, may want higher than 4000mb
                        swapoff -a

                        mkswap /swap_file

                        nano /etc/fstab
                        #delete previous swap entry then add
                        /swap_file swap swap defaults 0 0
                        #then save and exit

                        swap-offset /swap_file #remember the output of this
                        nano /etc/grub.d/40_custom
                        add to linux line: resume=<partition swapfile is on> resume_offset=<swap-offset return data>

                        swapon -a
                        nano /home/name/bin/hibernate_shutdown
                        #!/bin/bash
                        echo shutdown > /sys/power/disk
                        echo disk > /sys/power/state

                        create shortcut. system-settings->keyboard->shortcuts->custom shortcuts add
                        gnomesu /home/name/bin/hibernate_shutdown
                        set to F11
                        chmod +x /home/name/bin/hibernate_shutdown
                        restart computer


                        viola
                        if you want to restart after hibernate instead of shutdown



                        echo reboot > /sys/power/disk
                        echo disk > /sys/power/state





                        share|improve this answer




























                          0














                          You can make a swap file instead and hibernate with it too, I have made swap files on my laptop so I can hibernate each of my linux installations. Otherwise hibernate would just overwrite the last hibernation if I was using one swap partition. This is my method. Notice you must hibernate using the kernel method: echo disk > /sys/power/state



                          sudo -s 
                          fallocate -l 4000m /swap_file #4000 mb, may want higher than 4000mb
                          swapoff -a

                          mkswap /swap_file

                          nano /etc/fstab
                          #delete previous swap entry then add
                          /swap_file swap swap defaults 0 0
                          #then save and exit

                          swap-offset /swap_file #remember the output of this
                          nano /etc/grub.d/40_custom
                          add to linux line: resume=<partition swapfile is on> resume_offset=<swap-offset return data>

                          swapon -a
                          nano /home/name/bin/hibernate_shutdown
                          #!/bin/bash
                          echo shutdown > /sys/power/disk
                          echo disk > /sys/power/state

                          create shortcut. system-settings->keyboard->shortcuts->custom shortcuts add
                          gnomesu /home/name/bin/hibernate_shutdown
                          set to F11
                          chmod +x /home/name/bin/hibernate_shutdown
                          restart computer


                          viola
                          if you want to restart after hibernate instead of shutdown



                          echo reboot > /sys/power/disk
                          echo disk > /sys/power/state





                          share|improve this answer


























                            0












                            0








                            0







                            You can make a swap file instead and hibernate with it too, I have made swap files on my laptop so I can hibernate each of my linux installations. Otherwise hibernate would just overwrite the last hibernation if I was using one swap partition. This is my method. Notice you must hibernate using the kernel method: echo disk > /sys/power/state



                            sudo -s 
                            fallocate -l 4000m /swap_file #4000 mb, may want higher than 4000mb
                            swapoff -a

                            mkswap /swap_file

                            nano /etc/fstab
                            #delete previous swap entry then add
                            /swap_file swap swap defaults 0 0
                            #then save and exit

                            swap-offset /swap_file #remember the output of this
                            nano /etc/grub.d/40_custom
                            add to linux line: resume=<partition swapfile is on> resume_offset=<swap-offset return data>

                            swapon -a
                            nano /home/name/bin/hibernate_shutdown
                            #!/bin/bash
                            echo shutdown > /sys/power/disk
                            echo disk > /sys/power/state

                            create shortcut. system-settings->keyboard->shortcuts->custom shortcuts add
                            gnomesu /home/name/bin/hibernate_shutdown
                            set to F11
                            chmod +x /home/name/bin/hibernate_shutdown
                            restart computer


                            viola
                            if you want to restart after hibernate instead of shutdown



                            echo reboot > /sys/power/disk
                            echo disk > /sys/power/state





                            share|improve this answer













                            You can make a swap file instead and hibernate with it too, I have made swap files on my laptop so I can hibernate each of my linux installations. Otherwise hibernate would just overwrite the last hibernation if I was using one swap partition. This is my method. Notice you must hibernate using the kernel method: echo disk > /sys/power/state



                            sudo -s 
                            fallocate -l 4000m /swap_file #4000 mb, may want higher than 4000mb
                            swapoff -a

                            mkswap /swap_file

                            nano /etc/fstab
                            #delete previous swap entry then add
                            /swap_file swap swap defaults 0 0
                            #then save and exit

                            swap-offset /swap_file #remember the output of this
                            nano /etc/grub.d/40_custom
                            add to linux line: resume=<partition swapfile is on> resume_offset=<swap-offset return data>

                            swapon -a
                            nano /home/name/bin/hibernate_shutdown
                            #!/bin/bash
                            echo shutdown > /sys/power/disk
                            echo disk > /sys/power/state

                            create shortcut. system-settings->keyboard->shortcuts->custom shortcuts add
                            gnomesu /home/name/bin/hibernate_shutdown
                            set to F11
                            chmod +x /home/name/bin/hibernate_shutdown
                            restart computer


                            viola
                            if you want to restart after hibernate instead of shutdown



                            echo reboot > /sys/power/disk
                            echo disk > /sys/power/state






                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Jun 1 '13 at 14:27









                            CraigCraig

                            4612




                            4612






























                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Ask Ubuntu!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function () {
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f299417%2fdoes-it-make-sense-to-create-swap-partitions-for-new-installations-nowadways%23new-answer', 'question_page');
                                }
                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                數位音樂下載

                                When can things happen in Etherscan, such as the picture below?

                                格利澤436b