But the OS is committing to supplying memory for any writable pages you duplicated, because after all you might write to them. The OS doesn't know which pages you won't duplicate.
Unless you set your vm.overcommit_memory sysctl variable to 1 (= never refuse malloc), duplicated writable pages are going to subtract from available memory, even if all copies are currently the same.
Unless you set your vm.overcommit_memory sysctl variable to 1 (= never refuse malloc), duplicated writable pages are going to subtract from available memory, even if all copies are currently the same.