hotspot/src/os/windows/vm/os_windows.cpp
changeset 39390 edf6a424a8b7
parent 38640 28f6c0c855cf
child 39451 19cd3b995de9
equal deleted inserted replaced
39281:84e5f0fc2112 39390:edf6a424a8b7
  4181     actual_reserve_size = default_reserve_size;
  4181     actual_reserve_size = default_reserve_size;
  4182   }
  4182   }
  4183 
  4183 
  4184   // Check minimum allowable stack size for thread creation and to initialize
  4184   // Check minimum allowable stack size for thread creation and to initialize
  4185   // the java system classes, including StackOverflowError - depends on page
  4185   // the java system classes, including StackOverflowError - depends on page
  4186   // size.  Add a page for compiler2 recursion in main thread.
  4186   // size.  Add two 4K pages for compiler2 recursion in main thread.
  4187   // Add in 2*BytesPerWord times page size to account for VM stack during
  4187   // Add in 4*BytesPerWord 4K pages to account for VM stack during
  4188   // class initialization depending on 32 or 64 bit VM.
  4188   // class initialization depending on 32 or 64 bit VM.
  4189   size_t min_stack_allowed =
  4189   size_t min_stack_allowed =
  4190             (size_t)(JavaThread::stack_yellow_zone_size() + JavaThread::stack_red_zone_size() +
  4190             (size_t)(JavaThread::stack_guard_zone_size() +
  4191                      JavaThread::stack_shadow_zone_size() +
  4191                      JavaThread::stack_shadow_zone_size() +
  4192                      (2*BytesPerWord COMPILER2_PRESENT(+1)) * os::vm_page_size());
  4192                      (4*BytesPerWord COMPILER2_PRESENT(+2)) * 4 * K);
       
  4193 
       
  4194   min_stack_allowed = align_size_up(min_stack_allowed, os::vm_page_size());
       
  4195 
  4193   if (actual_reserve_size < min_stack_allowed) {
  4196   if (actual_reserve_size < min_stack_allowed) {
  4194     tty->print_cr("\nThe stack size specified is too small, "
  4197     tty->print_cr("\nThe stack size specified is too small, "
  4195                   "Specify at least %dk",
  4198                   "Specify at least %dk",
  4196                   min_stack_allowed / K);
  4199                   min_stack_allowed / K);
  4197     return JNI_ERR;
  4200     return JNI_ERR;