659 #else 660 661 if (bytes < 2 * G) { 662 return true; 663 } 664 665 char* addr = reserve_memory(bytes, NULL); 666 667 if (addr != NULL) { 668 release_memory(addr, bytes); 669 } 670 671 return addr != NULL; 672 #endif // AMD64 673 } 674 675 //////////////////////////////////////////////////////////////////////////////// 676 // thread stack 677 678 #ifdef AMD64 679 size_t os::Linux::min_stack_allowed = 64 * K; 680 #else 681 size_t os::Linux::min_stack_allowed = (48 DEBUG_ONLY(+4))*K; 682 #endif // AMD64 683 684 // return default stack size for thr_type 685 size_t os::Linux::default_stack_size(os::ThreadType thr_type) { 686 // default stack size (compiler thread needs larger stack) 687 #ifdef AMD64 688 size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M); 689 #else 690 size_t s = (thr_type == os::compiler_thread ? 2 * M : 512 * K); 691 #endif // AMD64 692 return s; 693 } 694 695 size_t os::Linux::default_guard_size(os::ThreadType thr_type) { 696 // Creating guard page is very expensive. Java thread has HotSpot 697 // guard page, only enable glibc guard page for non-Java threads. 698 return (thr_type == java_thread ? 0 : page_size()); 699 } 700 701 // Java thread: 702 // 703 // Low memory addresses 704 // +------------------------+ 705 // | |\ JavaThread created by VM does not have glibc | 659 #else 660 661 if (bytes < 2 * G) { 662 return true; 663 } 664 665 char* addr = reserve_memory(bytes, NULL); 666 667 if (addr != NULL) { 668 release_memory(addr, bytes); 669 } 670 671 return addr != NULL; 672 #endif // AMD64 673 } 674 675 //////////////////////////////////////////////////////////////////////////////// 676 // thread stack 677 678 #ifdef AMD64 679 size_t os::Posix::_compiler_thread_min_stack_allowed = 64 * K; 680 size_t os::Posix::_java_thread_min_stack_allowed = 64 * K; 681 size_t os::Posix::_vm_internal_thread_min_stack_allowed = 64 * K; 682 #else 683 size_t os::Posix::_compiler_thread_min_stack_allowed = (48 DEBUG_ONLY(+ 4)) * K; 684 size_t os::Posix::_java_thread_min_stack_allowed = (48 DEBUG_ONLY(+ 4)) * K; 685 size_t os::Posix::_vm_internal_thread_min_stack_allowed = (48 DEBUG_ONLY(+ 4)) * K; 686 #endif // AMD64 687 688 // return default stack size for thr_type 689 size_t os::Posix::default_stack_size(os::ThreadType thr_type) { 690 // default stack size (compiler thread needs larger stack) 691 #ifdef AMD64 692 size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M); 693 #else 694 size_t s = (thr_type == os::compiler_thread ? 2 * M : 512 * K); 695 #endif // AMD64 696 return s; 697 } 698 699 size_t os::Linux::default_guard_size(os::ThreadType thr_type) { 700 // Creating guard page is very expensive. Java thread has HotSpot 701 // guard page, only enable glibc guard page for non-Java threads. 702 return (thr_type == java_thread ? 0 : page_size()); 703 } 704 705 // Java thread: 706 // 707 // Low memory addresses 708 // +------------------------+ 709 // | |\ JavaThread created by VM does not have glibc |