File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/java.base/share/classes/java/lang Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -87,8 +87,12 @@ final class ProcessHandleImpl implements ProcessHandle {
8787 ThreadGroup tg = Thread .currentThread ().getThreadGroup ();
8888 while (tg .getParent () != null ) tg = tg .getParent ();
8989 ThreadGroup systemThreadGroup = tg ;
90+
91+ // For a debug build, the stack shadow zone is larger;
92+ // Increase the total stack size to avoid potential stack overflow.
93+ int debugDelta = "release" .equals (System .getProperty ("jdk.debug" )) ? 0 : (4 *4096 );
9094 final long stackSize = Boolean .getBoolean ("jdk.lang.processReaperUseDefaultStackSize" )
91- ? 0 : REAPER_DEFAULT_STACKSIZE ;
95+ ? 0 : REAPER_DEFAULT_STACKSIZE + debugDelta ;
9296
9397 ThreadFactory threadFactory = grimReaper -> {
9498 Thread t = new Thread (systemThreadGroup , grimReaper ,
You can’t perform that action at this time.
0 commit comments