-
Notifications
You must be signed in to change notification settings - Fork 6.3k
8366865: Allocation GC Pauses Triggered after JVM has started shutdown #27190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
eb95d49
4f512f6
89cf3cd
1c20e32
b3e1000
8a05ec4
d2f45cc
97c2108
187a463
0e45912
2ebff06
edad0ef
ab94789
e09a55f
1a53c20
46add7a
354e53c
87c8019
f1ec969
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -183,6 +183,7 @@ int Universe::_base_vtable_size = 0; | |
bool Universe::_bootstrapping = false; | ||
bool Universe::_module_initialized = false; | ||
bool Universe::_fully_initialized = false; | ||
volatile bool Universe::_is_shutting_down = false; | ||
|
||
OopStorage* Universe::_vm_weak = nullptr; | ||
OopStorage* Universe::_vm_global = nullptr; | ||
|
@@ -1344,7 +1345,14 @@ static void log_cpu_time() { | |
} | ||
|
||
void Universe::before_exit() { | ||
log_cpu_time(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you move There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Main reason was to have the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had put Please correct me if you think I got it wrong here. Nevertheless, any user of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can have GCs between
Yes, we can have the assert in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I moved |
||
{ | ||
// Acquire the Heap_lock to synchronize with VM_Heap_Sync_Operations, | ||
// which may depend on the value of _is_shutting_down flag. | ||
MutexLocker hl(Heap_lock); | ||
walulyai marked this conversation as resolved.
Show resolved
Hide resolved
|
||
log_cpu_time(); | ||
AtomicAccess::release_store(&_is_shutting_down, true); | ||
} | ||
|
||
heap()->before_exit(); | ||
|
||
// Print GC/heap related information. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,6 +128,9 @@ class Universe: AllStatic { | |
static bool _module_initialized; // true after call_initPhase2 called | ||
static bool _fully_initialized; // true after universe_init and initialize_vtables called | ||
|
||
// Shutdown | ||
static volatile bool _is_shutting_down; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If |
||
|
||
// the array of preallocated errors with backtraces | ||
static objArrayOop preallocated_out_of_memory_errors(); | ||
|
||
|
@@ -324,6 +327,8 @@ class Universe: AllStatic { | |
static bool is_module_initialized() { return _module_initialized; } | ||
static bool is_fully_initialized() { return _fully_initialized; } | ||
|
||
static bool is_shutting_down() { return AtomicAccess::load_acquire(&_is_shutting_down); } | ||
|
||
static bool on_page_boundary(void* addr); | ||
static bool should_fill_in_stack_trace(Handle throwable); | ||
static void check_alignment(uintx size, uintx alignment, const char* name); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer this to the Monitor::wait too. Thanks