[Development] QProcess fork() failure and overcommit
christian.kandeler at qt.io
Wed Mar 8 13:51:49 CET 2017
On 03/07/2017 10:05 PM, Thiago Macieira wrote:
> Em terça-feira, 7 de março de 2017, às 17:53:41 CET, René J.V. Bertin
>> One tends to forget (I do at least) that spawning a little helper process
>> can be quite expensive, sometimes prohibitively so. Makes you wonder what
>> kind of cross-platform alternatives there are!
> It shouldn't be.
> fork() does need to copy the page tables and mark the pages as shared. It also
> means COW of certain pages. But the overhead shouldn't be that big.
> If anyone is seeing this, can you run your application with strace to get the
> strace -T -e clone
I use the default settings for overcommit (0/heuristic). My application
starts QProcesses in a loop. If the application has not allocated
additional memory, strace -T for clone() gives:
Here's the same application using 1GB of additional memory:
So, factors around 100?
(Also, I get lots of ERESTARTNOINTR in the latter case).
More information about the Development