Request for review (XXS): 7067973: test/java/lang/management/MemoryMXBean/ hanging intermittently

Bengt Rutisson bengt.rutisson at
Thu May 31 20:04:17 UTC 2012

Hi all,

Can I have a couple of reviews for this really small change?

The CollectionUsageThreshold test fails with G1. The test lowers the 
notification threshold for the G1 old gen memory pool and expects to get 
a notification after a full GC.

The problem in G1 is that the decision to send the notification is done 
in TraceMemoryManagerStats::~TraceMemoryManagerStats(). This eventually 
does pool->get_memory_usage() to get the memory usage after a 
collection. The problem is that we update this information in 
G1MonitoringSupport::update_sizes() which is called in 
G1CollectedHeap::do_collection() _after_ the TraceMemoryManagerStats 
scope had been exited.

Extending the scope to cover the call to 
G1MonitoringSupport::update_sizes() solves the issue.

Before this change the CollectionUsageThreshold failed every time I ran 
it. After this change it passes every time I ran it.


More information about the hotspot-gc-dev mailing list