RFR: 8277531: Print actual default stacksize on Windows thread logging
KIRIYAMA Takuya
duke at openjdk.java.net
Fri Dec 3 09:33:15 UTC 2021
On Fri, 26 Nov 2021 13:55:32 GMT, David Holmes <david.holmes at oracle.com> wrote:
> The problem is that os:;win32::default_stack_size() doesn't necessarily
> report the default stack size - it simply reports the stackSize of the
> initial main JavaThread thread. So if you print it, it should only be
> for JavaThreads that are not CompilerThreads.
In either case of JavaThreads or CompilerThreads,the stack_size argument of _beginthreadex() must be 0 when this code is executed.
According to MSDN document, If the stack_size argument can be 0, the operating system uses the same value as the stack that's specified for the main thread.
default_stack_size is specified in create_vm() which runs in the main thread, so we use default_stack_size() for CompilerThreads.
> But if you run "java -Xss256k -XX:ThreadStackSize=512K" it will print
> 256K as the default stack size when in fact all JavaThreads except the
> main thread will get a 512K stack because of ThreadStackSize.
Yes,this behavior is odd. However, this fix executed only if stacksize is not specified.
This problem should be fixed in another issue.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6495
More information about the hotspot-runtime-dev
mailing list