Friday, December 3, 2010

To adjust the stack size in g++

from:http://gcc.gnu.org/ml/gcc-help/2004-01/msg00206.html
-------------------------------------------
The limit is OS or shell and not compiler dependent (as I understand it) and depends on what your stack size limit is. The default is often 8MB. You can view you current limit using the 'ulimit -s' command. It shows the limit in KB. You can set it to unlimited (or some other reasonable value) with the same command:

ulimit -s unlimited

or

ulimit -s 16384

to increase it to 16MB.
-------------------------------------------
Still have some trouble on allocate memory in g++...