Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.7.1
-
None
-
Embedde Linux, and maybe also Desktop Linux or any other Unix.
I've experianced it on Embedded ARM based Linux with no swap space and overcommit_memory=0 (the default)
-
028ddf3633f394c930ddb82551ef2d1fa9b1a04a (qt/qtbase/5.15)
Description
Imagine an embedded Linux system with 64mb of RAM, and Qt program that consumes 40mb.
This process will fail executing even a tiny program (e.g. "ls -l"), since the fork will first try to duplicate the creating process that that would mean the kernel committing to 80mb of RAM, even though it uses CopyOnWrite, the kernel's overcommit policy will not allow it.
instead of fork you should either use vfork or posix_spawn.
you can find some more info in:
http://developers.sun.com/solaris/articles/subprocess/subprocess.html
http://www.mail-archive.com/redhat-list@redhat.com/msg129118.html
http://www.kernel.org/doc/Documentation/sysctl/vm.txt