10th May 2017, 3:50
(9th May 2017, 16:44)rocky7x Wrote: Just to add my 2 cents Adding swap on an SSD disk is not really a good option, since SSD has a limited amount of writes possible. Therefore, if you use an SSD for a swap and the system swaps a lot, I think it will destroy the SSD in a short time.
Agree - hence i deliberately put my Swap partition on my HDD not my SSD when i setup my Tower.
However, correct me if i'm mistaken, but that [good] advice only pertains to a physical Swap partition, doesn't it? My [new] interest, having learned of it from leszek's cool info, is now zram - which i thought i understood runs in RAM somehow [?], in which case the "traditional" Swap writes-caution doesn't apply...?
Having searched online for "zram vs tmpfs", i still have no clear answer, hence i still don't really understand if they coexist correctly, or would cause me problems. Whilst the following will seem crude, here is a basic idea of why i'm confused.
1. tmpfs occupies RAM
2. zram occupies RAM [albeit compressed]
3. Swap partition exists on a physical drive, & exists for data transfer once RAM is all consumed
4. If RAM space is consumed not only by the usual instantaneous working data, but also by tmpfs, & maybe also now by zram, then arithmetically there is now less free RAM available for newer working data... which ironically then increases the chance of Swap space being needed.
5. If that Swap is the traditional physical partition, then of course system responsivity decreases, but nothing catastrophic will occur.
6. Conversely if there is no physical Swap partition, but "only" zram, the system attempts to swap working data into this, but given this IS in RAM, & swapping is ONLY needed when RAM is low or exhausted... well, how can this work? Isn't this kinda like the old joke about trying to lift yourself off the ground by your shoelaces?
7. Additionally, how do zram & tmpfs negotiate with each other to decide "who" will get to grab the specific working data that the kernel is trying to swap out? If they "argue" instead of "cooperate", then surely "bad things" will result?
As you can see, i still don't understand.