Hacker News new | past | comments | ask | show | jobs | submit login

Keep in mind that copy-on-write makes analysing the situation a bit more complicated.



How so?


CoW is a strategy where you don't actually copy memory until you write to it. So, when the 10GB process spawns a child process, that child process also has 10GB of virtual memory, but both processes are backed by the same pages. It's only when one of them writes to a page that a copy happens. When you fork+exec you never actually touch most of those pages, so you never actually pay for them.

(Obviously, that's the super-simplified version, and I don't fully understand the subtleties involved, but that's exactly what GP means: it's harder to analyse)


Thanks for writing the explanation.

To make it slightly more complicated: you don't pay for the 10 GB directly, but you still pay for setting up the metadata, and that scales with the amount of virtual memory used.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: