src/os/bsd/vm/os_bsd.cpp

Print this page




3525                  (intptr_t)mem_serialize_page);
3526     }
3527 #endif
3528   }
3529 
3530   // initialize suspend/resume support - must do this before signal_sets_init()
3531   if (SR_initialize() != 0) {
3532     perror("SR_initialize failed");
3533     return JNI_ERR;
3534   }
3535 
3536   Bsd::signal_sets_init();
3537   Bsd::install_signal_handlers();
3538 
3539   // Check minimum allowable stack size for thread creation and to initialize
3540   // the java system classes, including StackOverflowError - depends on page
3541   // size.  Add a page for compiler2 recursion in main thread.
3542   // Add in 2*BytesPerWord times page size to account for VM stack during
3543   // class initialization depending on 32 or 64 bit VM.
3544   os::Bsd::min_stack_allowed = MAX2(os::Bsd::min_stack_allowed,
3545                                     (size_t)(StackYellowPages+StackRedPages+StackShadowPages+
3546                                     2*BytesPerWord COMPILER2_PRESENT(+1)) * Bsd::page_size());
3547 
3548   size_t threadStackSizeInBytes = ThreadStackSize * K;
3549   if (threadStackSizeInBytes != 0 &&
3550       threadStackSizeInBytes < os::Bsd::min_stack_allowed) {
3551     tty->print_cr("\nThe stack size specified is too small, "
3552                   "Specify at least %dk",
3553                   os::Bsd::min_stack_allowed/ K);
3554     return JNI_ERR;
3555   }
3556 
3557   // Make the stack size a multiple of the page size so that
3558   // the yellow/red zones can be guarded.
3559   JavaThread::set_stack_size_at_create(round_to(threadStackSizeInBytes,
3560                                                 vm_page_size()));
3561 
3562   if (MaxFDLimit) {
3563     // set the number of file descriptors to max. print out error
3564     // if getrlimit/setrlimit fails but continue regardless.
3565     struct rlimit nbr_files;




3525                  (intptr_t)mem_serialize_page);
3526     }
3527 #endif
3528   }
3529 
3530   // initialize suspend/resume support - must do this before signal_sets_init()
3531   if (SR_initialize() != 0) {
3532     perror("SR_initialize failed");
3533     return JNI_ERR;
3534   }
3535 
3536   Bsd::signal_sets_init();
3537   Bsd::install_signal_handlers();
3538 
3539   // Check minimum allowable stack size for thread creation and to initialize
3540   // the java system classes, including StackOverflowError - depends on page
3541   // size.  Add a page for compiler2 recursion in main thread.
3542   // Add in 2*BytesPerWord times page size to account for VM stack during
3543   // class initialization depending on 32 or 64 bit VM.
3544   os::Bsd::min_stack_allowed = MAX2(os::Bsd::min_stack_allowed,
3545                                     (size_t)(StackReservedPages+StackYellowPages+StackRedPages+StackShadowPages+
3546                                     2*BytesPerWord COMPILER2_PRESENT(+1)) * Bsd::page_size());
3547 
3548   size_t threadStackSizeInBytes = ThreadStackSize * K;
3549   if (threadStackSizeInBytes != 0 &&
3550       threadStackSizeInBytes < os::Bsd::min_stack_allowed) {
3551     tty->print_cr("\nThe stack size specified is too small, "
3552                   "Specify at least %dk",
3553                   os::Bsd::min_stack_allowed/ K);
3554     return JNI_ERR;
3555   }
3556 
3557   // Make the stack size a multiple of the page size so that
3558   // the yellow/red zones can be guarded.
3559   JavaThread::set_stack_size_at_create(round_to(threadStackSizeInBytes,
3560                                                 vm_page_size()));
3561 
3562   if (MaxFDLimit) {
3563     // set the number of file descriptors to max. print out error
3564     // if getrlimit/setrlimit fails but continue regardless.
3565     struct rlimit nbr_files;