2 ms·
> processes are allocated their own and thus consume more memory. Copy-on-write means this needn't be a large overhead. Only pages that change after forking ar
by robotresearcher 10y ago
> processes are allocated their own and thus consume more memory.
Copy-on-write means this needn't be a large overhead. Only pages that change after forking are duplicated.
- mortehu 10y agoBut 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.
- robotresearcher 10y agoSure. So your memory usage is reported as high but might not be actually high. Some sophistication is needed to interpret resource counts.