• 0 Posts
  • 5 Comments
Joined 3 years ago
cake
Cake day: July 7th, 2023

help-circle
  • yes, the system will likely use some swap if available even when there’s plenty of free RAM left:

    The casual reader1 may think that with a sufficient amount of memory, swap is unnecessary but this brings us to the second reason. A significant number of the pages referenced by a process early in its life may only be used for initialisation and then never used again. It is better to swap out those pages and create more disk buffers than leave them resident and unused.

    Src: https://www.kernel.org/doc/gorman/html/understand/understand014.html

    In my recently booted system with 32GB and half of that free (not even “available”), I can already see 10s of MB of swap used.

    As rule of thumb, it’s only a concern or indication that the system is/was starved of memory if a significant share of swap is in use. But even then, it might just be some cached pages hanging around because the kernel decided to keep instead of evicting them.


  • if my system touches SWAP at all, it’s run out of memory

    That’s a swap myth. Swap is not an emergency memory, it’s about creating a memory reclamation space on disk for anonymous pages (pages that are not file-backed) so that the OS can more efficiently use the main memory.

    The swapping algorithm does take into account the higher cost of putting pages in swap. Touching swap may just mean that a lot of system files are being cached, but that’s reclaimable space and it doesn’t mean the system is running out of memory.


  • I disagree. What I could hack over a weekend starting a project, I can do in a couple hours with AI, because starting a project is where the typing bottleneck is, due to all of the boilerplate. I can’t type faster than an LLM.

    Also, because there are hundreds of similar projects out there and I won’t get to the parts that make mine unique in a weekend, that’s the perfect use case for “vibe coding”.