RFR: JDK-8243991 Use standard -Xss argument in java command line
Erik Joelsson
erik.joelsson at oracle.com
Tue Apr 28 14:28:06 UTC 2020
On 2020-04-28 03:49, Magnus Ihse Bursie wrote:
>
>
> 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?
>
I really don't know the history on why those values are set. If the
build works without, and there is no significant performance loss, then
I would vote remove.
/Erik
> /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