RFR: 8277531: Print actual default stacksize on Windows thread logging

David Holmes david.holmes at oracle.com
Fri Nov 26 13:53:25 UTC 2021


On 26/11/2021 10:33 pm, Takuya Kiriyama wrote:
> On Mon, 22 Nov 2021 09:22:39 GMT, Takuya Kiriyama <duke at openjdk.java.net> wrote:
> 
>> I modified to log actual stack size on Windows by using `os::win32::default_stack_size()`.
>> Could you please review this fix?
> 
> Thank you so much for your review.
> Sorry it took me so long to understand discussion.
> 
> Is there something wrong to print out the value of default_stack_size?
> I could not confirm the problem when I combine -Xss with -XX:ThreadStackSize., but it doesn't affect this patch.

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.

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.

So given you can't actually print a value that you know to be correct, 
it may be best just to leave this as "default" - and perhaps this is why 
it was that way to begin with.

Cheers,
David

> I will try to fix this test for -Xss, -XX:ThreadStackSize, -XX:CompilerThreadStackSize and -XX:VMThreadStackSize.
> Please let me know if there are any other options which need to be tested.
> 
> -------------
> 
> PR: https://git.openjdk.java.net/jdk/pull/6495
> 


More information about the hotspot-runtime-dev mailing list