3 ms·
The Redis example is a little different: "fork() e.g. Redis: Calling fork marks all of the process's pages as copy-on-write. Then when a single byte on a page
by kris_wayton 4y ago
The Redis example is a little different:
"fork() e.g. Redis: Calling fork marks all of the process's pages as copy-on-write. Then when a single byte on a page is modified, the page must be copied. Redis uses fork to create a read-only "snapshot" of memory, when writing a checkpoint to disk."
So prior, that fork forced only a rewrite of some collection of 4kb pages. Afterwards, obviously much larger rewrites.
- ignoramous 4y agoInterestingly a common pattern: fork (and no exec) is also what Android does [0] to not only speed up Kotlin / Java app start-up but save on allocation of shared dex/bytecode (a couple dozen megabytes); code: https://archive.is/GMka3 https://archive.is/GMka3 [0] The state of ASLR on Android 5 (2015), https://archive.is/ADx65 https://archive.is/ADx65 (copperhead.co).