853 #endif
854
855 #endif // AMD64
856
857 // return default stack size for thr_type
858 size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
859 // default stack size (compiler thread needs larger stack)
860 #ifdef AMD64
861 size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M);
862 #else
863 size_t s = (thr_type == os::compiler_thread ? 2 * M : 512 * K);
864 #endif // AMD64
865 return s;
866 }
867
868
869 // Java thread:
870 //
871 // Low memory addresses
872 // +------------------------+
873 // | |\ JavaThread created by VM does not have glibc
874 // | glibc guard page | - guard, attached Java thread usually has
875 // | |/ 1 page glibc guard.
876 // P1 +------------------------+ Thread::stack_base() - Thread::stack_size()
877 // | |\
878 // | HotSpot Guard Pages | - red and yellow pages
879 // | |/
880 // +------------------------+ JavaThread::stack_yellow_zone_base()
881 // | |\
882 // | Normal Stack | -
883 // | |/
884 // P2 +------------------------+ Thread::stack_base()
885 //
886 // Non-Java thread:
887 //
888 // Low memory addresses
889 // +------------------------+
890 // | |\
891 // | glibc guard page | - usually 1 page
892 // | |/
893 // P1 +------------------------+ Thread::stack_base() - Thread::stack_size()
894 // | |\
895 // | Normal Stack | -
896 // | |/
897 // P2 +------------------------+ Thread::stack_base()
898 //
899 // ** P1 (aka bottom) and size ( P2 = P1 - size) are the address and stack size returned from
900 // pthread_attr_getstack()
|
853 #endif
854
855 #endif // AMD64
856
857 // return default stack size for thr_type
858 size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
859 // default stack size (compiler thread needs larger stack)
860 #ifdef AMD64
861 size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M);
862 #else
863 size_t s = (thr_type == os::compiler_thread ? 2 * M : 512 * K);
864 #endif // AMD64
865 return s;
866 }
867
868
869 // Java thread:
870 //
871 // Low memory addresses
872 // +------------------------+
873 // | |\ Java thread created by VM does not have glibc
874 // | glibc guard page | - guard, attached Java thread usually has
875 // | |/ 1 page glibc guard.
876 // P1 +------------------------+ Thread::stack_base() - Thread::stack_size()
877 // | |\
878 // | HotSpot Guard Pages | - red, yellow and reserved pages
879 // | |/
880 // +------------------------+ JavaThread::stack_reserved_zone_base()
881 // | |\
882 // | Normal Stack | -
883 // | |/
884 // P2 +------------------------+ Thread::stack_base()
885 //
886 // Non-Java thread:
887 //
888 // Low memory addresses
889 // +------------------------+
890 // | |\
891 // | glibc guard page | - usually 1 page
892 // | |/
893 // P1 +------------------------+ Thread::stack_base() - Thread::stack_size()
894 // | |\
895 // | Normal Stack | -
896 // | |/
897 // P2 +------------------------+ Thread::stack_base()
898 //
899 // ** P1 (aka bottom) and size ( P2 = P1 - size) are the address and stack size returned from
900 // pthread_attr_getstack()
|