JDK-7173460 : G1: java/lang/management/MemoryMXBean/CollectionUsageThreshold.java failes with G1
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs24
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2012-06-01
  • Updated: 2014-12-02
  • Resolved: 2012-06-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8 Other
7u40Fixed 8Fixed hs24Fixed
Related Reports
Relates :  
Relates :  
java/lang/management/MemoryMXBean/CollectionUsageThreshold.java fails consistently 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.

EVALUATION http://hg.openjdk.java.net/lambda/lambda/hotspot/rev/b9442ac22f59

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-gc/hotspot/rev/b9442ac22f59