Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Consider dropping -Xss from launcher #3741
Some years ago, we force the default minimum stack size for JVM threads to 2048k, because the default (on 64-bit) of 1024k was too small for some recursion-heavy tools like Bundler. We blew out that stack a lot also because our AST was a recursive interpreter. Since then, bundler has been made iterative and we now interpret a flat structure...so it may be possible for us to drop our stack size tweaking too.
Relates to #3739.
@bbrowning If there's a test case that would fail if stack is too small, it might be interesting to try it with default stack size again.
I'm less gun-ho on this one because the worst it does now is make threads twice as large in memory, to the tune of a measly 1MB per. Unless you're running some 100-way machine that's not likely to matter much. It would just be nice to trim the fat in our launchers.
I ran some numbers.
All on Java 8u60, with the following code:
Here's interpreter. In 9.1 it is only the simple interpreter.
And with normal jit settings:
This difference in 9.1 is a bit of a worry. The interpreter seems about the same (I'd hope it would be better, even though this is a simple AST). The compiler is significantly worse. A general reason for this may be additional frames around our IR interpreted and compiled paths that could be collapsed. The compiler may suffer from invokedynamic "lambda forms" bloating the stack for early calls.
In any case, I don't think we're going to be able to drop the flag any time soon. I will open a separate bug for the poor stack depths in 9.1.