--- old/src/share/vm/runtime/thread.cpp 2018-01-24 21:13:48.000909090 -0500 +++ new/src/share/vm/runtime/thread.cpp 2018-01-24 21:13:47.946909092 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2485,7 +2485,15 @@ } void JavaThread::create_stack_guard_pages() { - if (! os::uses_stack_guard_pages() || _stack_guard_state != stack_guard_unused) return; + if (!os::uses_stack_guard_pages() || + _stack_guard_state != stack_guard_unused || + (DisablePrimordialThreadGuardPages && os::is_primordial_thread())) { + if (TraceThreadEvents) { + tty->print_cr("Stack guard page creation for thread " + UINTX_FORMAT " disabled", os::current_thread_id()); + } + return; + } address low_addr = stack_base() - stack_size(); size_t len = (StackYellowPages + StackRedPages) * os::vm_page_size();