2 ms·
I think what many people forget is that applications can ask for a bunch of memory and then never do anything with it (or just do something with it once). Imag
by 22c 2y ago
I think what many people forget is that applications can ask for a bunch of memory and then never do anything with it (or just do something with it once).
Imagine you want to write something down, so you ask me for a notebook. Now you start writing very slowly such that I can tell you're not going to need more than one page of that notebook for quite a while.
I don't want to take the notebook away from you because you're fussy and you insist on having the entire notebook to yourself, but someone else comes along also wanting to write something down.
Me being the clever kernel that I am, decide to let you keep a "virtual" copy of your notebook, but really only the first page of it is "real" paper and I give the notebook to the next person who ALSO insists on having an entire notebook to write down a few words on a page.
I can now have 20 people all writing in their own "virtual" 100 page notebooks, while I really only have a single 100 page notebook to go around.
Only when the combined total of all needed pages REALLY hits 100 pages will I start to run into issues.
- drsopp 2y agoSurely we can do this without writing anything to disk?
- 22c 2y agoI didn't really complete the analogy. Once you hit 100 actual pages of your notebook, I could either give up completely or I can say "Hey that first page you wrote to, I noticed you haven't used it in a while... I'm just going to store that in the filing cabinet." Now again we're fine and we're even past 100 pages, but if you ever need to read the page I stored in in the filing cabinet, I'll have to swap that page out for another page, which will be time consuming and inefficient.