Reputation: 6796
Basically I have the same problem with Go 1.2 as described here:
https://groups.google.com/forum/#!topic/golang-nuts/TYai0DVoYwg
Is there a way of increasing StackMin for my Go program without recompiling Go?
Upvotes: 3
Views: 108
Reputation: 86
StackMin is compiled into the runtime, so you can't change it without recompiling Go. You can find the constants here: http://golang.org/src/pkg/runtime/stack.h#L72
If you're unable to recompile Go, you can try to work around the hot split problem by artificially increasing the amount of stack space used by your program (i.e. insert var foo [2<<10]byte
into your code before the hot-split function calls) - but this could be hit-or-miss, and may need to be re-tuned as your program changes.
As Dmitry mentioned, Go 1.3 is planned to have contiguous stacks (not a linked list of stack segments) which get reallocated and copied to as needed. https://docs.google.com/document/d/1wAaf1rYoM4S4gtnPh0zOlGzWtrZFQ5suE8qr2sD8uWQ/pub
Upvotes: 5