JDK-8161093 : Solaris for >8k pagesize adds extra guard pages
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris
  • Submitted: 2016-07-08
  • Updated: 2016-12-06
  • Resolved: 2016-12-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10
10Resolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
min_stack_size allowed already accounts for guard zone and shadow zone:

os::Solaris::java_thread_min_stack_allowed = MAX2(os::Solaris::java_thread_min_stack_allowed,
                                                    JavaThread::stack_guard_zone_size() +
                                                    JavaThread::stack_shadow_zone_size() +
                                                    (4 * BytesPerWord COMPILER2_PRESENT(+ 2)) * 4 * K);


This extra adjustment to thread stack size is unnecessary and adds more stack space to running threads.   This was legacy code when the stack overflow handling code didn't know how to cope with large pages, which was fixed in linked bug.

  // For 64kbps there will be a 64kb page size, which makes
  // the usable default stack size quite a bit less.  Increase the
  // stack for 64kb (or any > than 8kb) pages, this increases
  // virtual memory fragmentation (since we're not creating the
  // stack on a power of 2 boundary.  The real fix for this
  // should be to fix the guard page mechanism.

  if (vm_page_size() > 8*K) {
    threadStackSizeInBytes = (threadStackSizeInBytes != 0)
       ? threadStackSizeInBytes +
         JavaThread::stack_red_zone_size() +
         JavaThread::stack_yellow_zone_size()
       : 0;
    ThreadStackSize = threadStackSizeInBytes/K;
  }