5 ms·
It's unfortunate how widely "virtual memory" is misunderstood to mean "an unlimited dynamic swap file". Why phones don't have unlimited dynamic swap and "why ca
by gok 7y ago
It's unfortunate how widely "virtual memory" is misunderstood to mean "an unlimited dynamic swap file". Why phones don't have unlimited dynamic swap and "why cannot Safari just save what it has downloaded to disk" are effectively the same question, just asked about the browser instead of the kernel. It would wear out the NAND chips on phone-class storage too quickly.
- scarface74 7y agoIt's no more "misunderstood" than "serverless", when someone feels the need to explain to the poor unwashed masses that servers are involved and your programs aren't being run using pixie dust. VM == Swap is shorthand that people have been using for well over two decades.
- mort96 7y agoThe word "serverless" is a new word which wasn't used for anything in particular, and it's fairly descriptive, as you don't have to manage severs, you just have code which runs whenever you make certain HTTP requests. Obviously there's a server involved, but you don't have to care about it (for the most part; obviously abstractions are leaky). The phrase "vrtual memory" is old and still widely used, and it refers to... virtual memory. The memory addresses programs use are virtual addresses into virtual memory, and the kernel sets up lookup tables to let the CPU resolve that virtual memory address into a physical memory address. Saying that "VM == Swap" might be common, but it still seems completely wrong, and makes people make ridiculous claims such as "unlike on the Mac, there is no virtual memory on the iPhone".
- scarface74 7y agoIn context of the article, do you really think that most readers on HN didn’t immediately know that the article was referring to a swap file? If you search on google right now for “virtual memory” for articles geared toward everyday people, you will see that the common vernacular is to refer to it being the same as the swap file. It’s referred to that way in Windows now and I remember “turning off virtual memory” being a control panel option on MacOS System 7 in 1991. If someone said that the “army was decimated” would you think, knowing how language has evolved, that they meant the army was reduced by 10% or that it was left in ruins? Would you go on to explain to the ignorant plebe and start a sentence with “well actually...”? When the term “virtual memory” came into the vernacular of everyday people, it was understood to mean swapping to disk. It’s the same old descriptivism vs prescriptivism debate. Most of the time when someone lands on the prescriptivism side it comes off as pedantic. Would you correct someone who said that they were buying a PC instead of Mac and say “well actually a Mac is s personal computer therefore it is also a PC”?
- Someone 7y ago”and I remember “turning off virtual memory” being a control panel option on MacOS System 7 in 1991” I think that truly turned off virtual memory (Mac OS 7 didn’t have separate address spaces, did it?)
- scarface74 7y agoNo it didn’t. There was only one address space. So yeah, it did literally turn off virtual memory. I went down a rabbit hole trying to remember the technical details of VM back in the day: https://retrocomputing.stackexchange.com/questions/2804/why-did-mac-os-7-perform-poorly-with-virtual-memory-enabled https://retrocomputing.stackexchange.com/questions/2804/why-... [old man rant] I remember having at the time an obscene 10MB of RAM in 1992 for my Mac LCII to avoid using VM and to run Soft PC acceptably. Then I had a whopping 24MB of RAM two years later for the PowerMac 6100/60 because it shared RAM with the DX2/66 DOS Card. Then two years later I bought 32MB of RAM to attach directly to the DOS Card... [/old_man_rant]
- verisimilitudes 7y ago>The word "serverless" is a new word which wasn't used for anything in particular, and it's fairly descriptive Using it to describe distributed systems comes to mind, and would be more sensible than its current, mistaken use.
- gok 7y agoI guess I was giving the author the benefit of the doubt... saying "I understand why there's no swap, but why can't it just write to disk when memory gets low?" is nonsensical.
- scarface74 7y agoThere is a difference between the app writing disk before it purged a web page and letting the OS page memory. Safari could theoretically be more intelligent about it. Or it could only swap pages that contain form fields where the user has entered data as a last resort.
- feld 7y ago"VM == swap" is an indicator for me to not hire that candidate
- scarface74 7y agoSo is someone saying “serverless” when they say they wrote a backend using Lambda also an indication?
- feld 7y agoYes
- vbezhenar 7y agoWhat is phone-class storage? Swap definitely does not wear out good SSD in typical scenarios. Why are phones different?
- gok 7y agoPrioritize power usage and physical density over write cycles.