In the two uses of G1MonitoringScope that is used to notify MXBeans about memory changes there is extra code to call `G1MonitoringSupport::update_sizes`. I.e.
{
G1MonitoringScope x(g1_monitoring_support, ...);
[...]
g1_monitoring_support->update_sizes();
}
The call at the end could be moved into the destructor of the G1MonitoringScope instance.
{
G1MonitoringScope x(g1_monitoring_support, ...);
[...]
g1_monitoring_support->update_sizes();
}
The call at the end could be moved into the destructor of the G1MonitoringScope instance.