--- a/hotspot/src/os/windows/vm/os_windows.cpp Tue Jun 14 19:38:44 2016 +0200
+++ b/hotspot/src/os/windows/vm/os_windows.cpp Mon Jun 13 09:28:25 2016 +0200
@@ -4183,13 +4183,16 @@
// Check minimum allowable stack size for thread creation and to initialize
// the java system classes, including StackOverflowError - depends on page
- // size. Add a page for compiler2 recursion in main thread.
- // Add in 2*BytesPerWord times page size to account for VM stack during
+ // size. Add two 4K pages for compiler2 recursion in main thread.
+ // Add in 4*BytesPerWord 4K pages to account for VM stack during
// class initialization depending on 32 or 64 bit VM.
size_t min_stack_allowed =
- (size_t)(JavaThread::stack_yellow_zone_size() + JavaThread::stack_red_zone_size() +
+ (size_t)(JavaThread::stack_guard_zone_size() +
JavaThread::stack_shadow_zone_size() +
- (2*BytesPerWord COMPILER2_PRESENT(+1)) * os::vm_page_size());
+ (4*BytesPerWord COMPILER2_PRESENT(+2)) * 4 * K);
+
+ min_stack_allowed = align_size_up(min_stack_allowed, os::vm_page_size());
+
if (actual_reserve_size < min_stack_allowed) {
tty->print_cr("\nThe stack size specified is too small, "
"Specify at least %dk",