File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
test/hotspot/jtreg/vmTestbase/gc/gctests/PhantomReference/phantom001 Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -177,14 +177,15 @@ public void run() {
177177 // If referent is finalizable, provoke GCs and wait for finalization.
178178 if (type .equals ("class" )) {
179179 progress ("Waiting for finalization: " + type );
180+ WhiteBox .getWhiteBox ().fullGC ();
180181 for (int checks = 0 ; !finalized && !shouldTerminate (); ++checks ) {
181- // There are scenarios where one WB.fillGC() isn't enough,
182- // but 10 iterations really ought to be sufficient.
182+ // Wait for up to 10 iterations that the finalizer has been run,
183+ // this ought to be sufficient. Full GCs and other threads might
184+ // starve out the finalizer thread, requiring more waiting.
183185 if (checks > 10 ) {
184186 fail ("Waiting for finalization: " + type );
185187 return ;
186188 }
187- WhiteBox .getWhiteBox ().fullGC ();
188189 // Give some time for finalizer to run.
189190 try {
190191 Thread .sleep (checks * 100 );
You can’t perform that action at this time.
0 commit comments