As Ian already explained, you're asking in the wrong place, because
there is no reason to believe this is a GCC issue.
The programming or linux-general forums at LQ would be a better place if
this discussion needs a lot of follow up.
http://www.linuxquestions.org/questions/
But for now, I'll give the basic answer:
Anna Sidera wrote:
They run for some time and then they stop. However when I run only 3 of them simultaneously, and then run the other 3, they all finish successfully.
The obvious explanation for that behavior would be you hit either the
system over commit limit or actual exhaustion of memory. Until you rule
that out, you shouldn't look for any more obscure theory.
Either one of those (over commit limit or exhaustion of memory) could be
dealt with by increasing the amount of swap space in the system. If you
lack enough physical memory to run 6 of those processes at once,
increasing swap space would stop that from crashing, but might just make
them crawl instead of crash. (Depending on what you mean by "stop",
that might already be what you are experiencing. You may need to
explain "stop" better in order to get a better answer).
I do not know if it is a bug or a problem with the memory the system allows me to use. The output of the ulimit -a command is the following:
That isn't relevant. No matter what ulimit allows each process to use,
it can't allow the total of all six processes to use more than is
available for the whole system.