“ … the operating system will create a new process that is exactly the same as the parent process. This means all the state that was talked about previously is copied,
including open files, register state and all memory allocations,which includes the program code.
The return value from the system call is the only way the process can determine if it was the existing process or a new one. The return value to the parent process will be the Process ID (PID) of the child, whilst the child will get a return value of 0."
“ … copy on write. This means that similar to threads above, the memory is actually shared, rather than copied, between the two processes when fork is called. If the processes are only going to be reading the memory, then actually copying the data is unnecessary.
However, when a process writes to its memory, it needs to be a private copy that is not shared. As the name suggests, copy on write optimises this by only doing the actual copy of the memory at the point when it is written to. "
Transparent Huge Pages（THP）关闭。在THP下，一个page会保存更多的key，因此父进程在处理写操作时可能会做更多的内存copy。
 09 Jul 14:39:20.564 * Background saving started by pid 44595  09 Jul 14:41:41.933 * DB saved on disk  09 Jul 14:41:42.179 * RDB: 134 MB of memory used by copy-on-write （这一行显示Redis在做RDB的过程中，主进程copy了多少内存）  09 Jul 14:41:42.679 * Background saving terminated with success