Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have large Boost/Spirit metaprogram that is blowing gcc's stack when I try to compile it.

How can I increase gcc's stack size, so I can compile this program?

Note: There's no infinite recursion going on, but there is enough incidental recursion to exhaust gcc's stack.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
729 views
Welcome To Ask or Share your Answers For Others

1 Answer

On Linux, you can expand the stack size in /etc/security/limits.conf.

You can check your current stack size by using

$ ulimit -s
8192

Then expand the stack to be double than that:

youruser    soft    stack    16384

And then relog.

This will increase stack size for all executable you're running, not just GCC's.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...