mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-27 23:31:47 +00:00
8086278: java/lang/ProcessHandle/TreeTest.java failed - ProcessReaper StackOverflowException
Increase reaper stack size by 50% to 48k Reviewed-by: chegar, martin
This commit is contained in:
parent
c5f11b19c4
commit
38659d2ed9
@ -51,6 +51,11 @@ import static java.security.AccessController.doPrivileged;
|
||||
* @since 9
|
||||
*/
|
||||
final class ProcessHandleImpl implements ProcessHandle {
|
||||
/**
|
||||
* Default size of stack for reaper processes.
|
||||
*/
|
||||
private static long REAPER_DEFAULT_STACKSIZE = 128 * 1024;
|
||||
|
||||
/**
|
||||
* Cache the ProcessHandle of this process.
|
||||
*/
|
||||
@ -79,10 +84,12 @@ final class ProcessHandleImpl implements ProcessHandle {
|
||||
ThreadGroup tg = Thread.currentThread().getThreadGroup();
|
||||
while (tg.getParent() != null) tg = tg.getParent();
|
||||
ThreadGroup systemThreadGroup = tg;
|
||||
final long stackSize = Boolean.getBoolean("jdk.lang.processReaperUseDefaultStackSize")
|
||||
? 0 : REAPER_DEFAULT_STACKSIZE;
|
||||
|
||||
ThreadFactory threadFactory = grimReaper -> {
|
||||
long stackSize = Boolean.getBoolean("jdk.lang.processReaperUseDefaultStackSize") ? 0 : 32768;
|
||||
Thread t = new Thread(systemThreadGroup, grimReaper, "process reaper", stackSize);
|
||||
Thread t = new Thread(systemThreadGroup, grimReaper,
|
||||
"process reaper", stackSize, false);
|
||||
t.setDaemon(true);
|
||||
// A small attempt (probably futile) to avoid priority inversion
|
||||
t.setPriority(Thread.MAX_PRIORITY);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user