Skip to content
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

8269908: Move MemoryService::track_memory_usage call into G1MonitoringScope #4687

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -2618,7 +2618,6 @@ void G1CollectedHeap::gc_epilogue(bool full) {
resize_all_tlabs();
phase_times()->record_resize_tlab_time_ms((os::elapsedTime() - start) * 1000.0);

MemoryService::track_memory_usage();
// We have just completed a GC. Update the soft reference
// policy with the new heap occupancy
Universe::heap()->update_capacity_and_used_at_gc();
@@ -2970,6 +2969,8 @@ void G1CollectedHeap::do_collection_pause_at_safepoint_helper(double target_paus
Threads::number_of_non_daemon_threads());
active_workers = workers()->update_active_workers(active_workers);
log_info(gc,task)("Using %u workers of %u for evacuation", active_workers, workers()->total_workers());

// JStat/MXBeans
G1MonitoringScope ms(g1mm(),
false /* full_gc */,
collector_state()->in_mixed_phase() /* all_memory_pools_affected */);
@@ -351,4 +351,6 @@ G1MonitoringScope::G1MonitoringScope(G1MonitoringSupport* g1mm, bool full_gc, bo

G1MonitoringScope::~G1MonitoringScope() {
_g1mm->update_sizes();
// Needs to be called after updating pool sizes.
MemoryService::track_memory_usage();
}