JDK-8038928 : gc/g1/TestGCLogMessages.java fail with "[Evacuation Failure' found"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs25,8u20,9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-04-01
  • Updated: 2015-01-21
  • Resolved: 2014-05-12
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.
8u40Fixed 9 b15Fixed
java.lang.RuntimeException: '[Evacuation Failure' found in stdout 

	at com.oracle.java.testlibrary.OutputAnalyzer.shouldNotContain(OutputAnalyzer.java:119)
	at TestGCLogMessages.testNormalLogs(TestGCLogMessages.java:89)
	at TestGCLogMessages.main(TestGCLogMessages.java:38)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:484)
	at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
	at java.lang.Thread.run(Thread.java:744)

JavaTest Message: Test threw exception: java.lang.RuntimeException: '[Evacuation Failure' found in stdout 

JavaTest Message: shutting down test
/* - * @test TestPrintGCDetails + * @test TestGCLogMessages * @bug 8035406 8027295 8035398 8019342 * @summary Ensure that the PrintGCDetails output for a minor GC with G1 * includes the expected necessary messages. @@ -90,12 +90,6 @@ output.shouldContain("[String Dedup Fixup"); output.shouldContain("[Young Free CSet"); output.shouldContain("[Non-Young Free CSet"); - - // also check evacuation failure messages once - output.shouldNotContain("[Evacuation Failure"); - output.shouldNotContain("[Recalculate Used"); - output.shouldNotContain("[Remove Self Forwards"); - output.shouldNotContain("[Restore RemSet"); output.shouldHaveExitValue(0); }

I don't think that we can reliably guarantee that an evacuation failure will never happen for this test so it will never be reliable in a meaningful way. The test could be changed to not allocate as much as it does and so always avoid an evacuation failure but that reduces the value of the test. I'm removing the check for the evacuation failure messages for the execution of the GCTest. The test can reliably configure the heap and allocations so that an evacuation failure can be guaranteed so that part of the test is left in.

I've reproduced this failure on a linux 64bit, product build. It looks like eden is growing so large that it is using up enough regions such that there is not enough regions available for promotions.

Fragmentation in the G1 heap is a variable that is not easily controlled. To reduce some of the variability which may impact fragmentation, 1) Use AlwaysTenure to reduce variation in object promotions. Just promote them all. See change 4). AlwaysTenure will remove variations with respect to survivor space overflow which can affect which objects get promoted. 2) Use 2 GC threads so that the number of GC threads is fixed and so the number of promotion LABS will be fixed. For GCTestWithToSpaceExhaustion 3) Allocate objects 1/4M in size rather than a 5M object which would invoke humongous object allocation. 4) Allocate live objects until an out-of-memory (OOM) occurs. The GC's that happen on the way to an OOM will experience an "Evacuation Failure". The previous test experience an Evacuation Failure because there were no empty heap regions for promotion. That will not always be the case (i.e., some of the young regions may be nearly empty an improvement to G1 to compact regions into themselves would allow the test to run without ever experiencing an "Evacualtion Failure". 5) Ignore the exit. This is a test of the logging output and should pass whether the process normally exits or not. Test the way the process exits in another test if necessary

Added 'hs25' to "Affects Version/s" field solely for matching failures in JDK9 nightlies. JDK9 hotspot versions are still reported as HSX25-B62.

Looks like the G1 heuristics is sizing eden in a way which leaves no room for survivor regions and the old gen can't accommodate the 128K allocation needed. Not quite sure if the heuristics should allow this situation or if it's just doesn't work that well on very small heaps. The heap is 10M in this case. I=Test problem or possibly heuristics problem for very small heaps -> L L=Seen at least twice, but not instantly reproducible -> H W=No known to work at this time (but using a larger heap or setting a fixed size young gen might work) -> H LHH=P4