RFR: JDK-8243991 Use standard -Xss argument in java command line
Magnus Ihse Bursie
magnus.ihse.bursie at oracle.com
Tue Apr 28 10:49:49 UTC 2020
On 2020-04-28 12:17, David Holmes wrote:
> Hi Magnus,
>
> On 28/04/2020 7:42 pm, Magnus Ihse Bursie wrote:
>> We should use the official -Xss argument[1] in command lines, instead
>> of the non-standard -XX:ThreadStackSize.
>>
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8243991
>> WebRev:
>> http://cr.openjdk.java.net/~ihse/JDK-8243991-fix-Xss-in-java-args/webrev.01
>
> This isn't right. ThreadStackSize takes a value in KB, whereas -Xss is
> a value in bytes. You won't be able to even start the VM with the
> values you have specified.
Hm, I need to double-check that. I've extracted this as a separate fix
for another bug I've been working on, since it was mostly unrelated to
that fix, but I had no issues starting the VM.
I fail to understand, though, why we use this peculiar value for the
stack size. Now that you mention it, I'm not even sure if that the
original author intended this to be in bytes or kilobytes. My gut
feeling is that 1536 bytes is a very small stack, and 1536 kB is a very
large stack. I always assumed that the intention was to make the stack
smaller than the default (which is, if I understand the documentation
correct -- and the documentation corresponds to reality) 1024 kB, to
make apps that spawn a large number of threads take less memory. But if
your statement is correct it is actually making the stacks 50% larger!
Maybe I need to expand on this patch a bit and check different values of
the stack size. And maybe we should not even set the argument at all, if
we can build correctly without it.
Do you see any reason to keep the argument if we can build fine without it?
/Magnus
>
> Cheers,
> David
>
>> /Magnus
>>
>> [1]
>> https://docs.oracle.com/en/java/javase/14/docs/specs/man/java.html#extra-options-for-java
>>
More information about the build-dev
mailing list