Sunday, April 28, 2024
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 1672  / 2 Years ago, tue, february 22, 2022, 9:26:28

I am reading some tutorials about swap for Ubuntu and in general for other distributions. Mostly from:



From there, it refers to other valuable tutorials of the same domain, of course all about swap, among them the information is well covered and very well explained.


According with them: if the PC/Laptop has either 8GB or less is recommended use swap how a dedicated partition - it normally x2 of the current RAM capacity available (mostly when Hibernating is applied). Until here I am ok for some laptops and old PC Desktops. Be aware, they have HDD about their hard-disks.


Something of my concern is that use swap impacts the SSD's lifespan, so is suggested use swap file instead. It is suggested for other scenario about to avoid resize the swap partition


So until here swap file is valuable for:



  • Accomplish a manual administration about the swap size without a partition being involved and to avoid harm the SSD lifespan


So I want to know if is a recommendable apply the swap file approach for these PC/Laptops with either 4GB and 8GB of RAM - currently they have HDD but some of them would be upgraded to SSD when themselves passed/gone away


The goal is have one standard approach and avoid use the swap partition. I think the manual administration is flexible than a raw/fixed partition.


Therefore:



  • Is wise and safe use swap file for PCs/Laptops of 8GB or less?


it without matter if the hard disks are currently either HDD or SSD.


About SSD Lifespan


This case is mentioned here:



More From » partitioning

 Answers
0

The Default in New Install


Ubuntu uses a swap file in all new installation by default since version 17.04.


Ubuntu installation does not change this default based on whether you install Ubuntu on a SSD or a HDD.


Therefore I conclude that it is safe and wise to use a swap file with a SSD and a HDD.


Other Issues


SSDs are Fragile


There is a lot of information on the web on how SSDs are fragile and will breakdown with excessive writes (and reads). There is a recent report that finds the SSDs are as reliable as HDDs. The specifics are sparse and this may only be strictly true for enterprise/server grade drives.


Alternately one can look at original manufacturer warranties as another metric of reliability of SSDs. the consumer grade (cheap ones) SSDs and HDDs come with 3 years of warranty. This tells me for normal use the issue of an SSD breaking down may not be a problem.


How Much Swap


This topic has been hashed to death as well. Here is my two-cent's worth. The swap size is often linked to the RAM size with various rules of thumbs. What is often lost in translation is the size of swap depends on the use of the computer.


I will give you a personal example. I have a desktop with 32GB of RAM and 8GB swap (in SSD). Yet once (and only once) I managed to run out of swap. I was working with a number of large datasets in R. The code I wrote kept on loading various datasets in RAM without unloading them when they were not needed anymore. In this case, it was just bad coding practice on my part. My stopgap solution to add another 64GB of swap and run the "bad" code again. This time it worked and I got the results I needed. I fixed the code later.


Hope this helps


[#707] Thursday, February 24, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
chilgirlguid

Total Points: 123
Total Questions: 114
Total Answers: 121

Location: Macau
Member since Mon, Nov 16, 2020
4 Years ago
;