comparison src/share/vm/runtime/java.cpp @ 12275:63147986a428

8019835: Strings interned in different threads equal but does not == Summary: Add -XX:+VerifyStringTableAtExit option and code to verify StringTable invariants. Reviewed-by: rdurbin, sspitsyn, coleenp
author dcubed
date Wed, 18 Sep 2013 07:02:10 -0700
parents 71180a6e5080
children cefad50507d8 d13d7aba8c12
comparison
equal deleted inserted replaced
12218:6f45933aef35 12275:63147986a428
542 542
543 // Shutdown NMT before exit. Otherwise, 543 // Shutdown NMT before exit. Otherwise,
544 // it will run into trouble when system destroys static variables. 544 // it will run into trouble when system destroys static variables.
545 MemTracker::shutdown(MemTracker::NMT_normal); 545 MemTracker::shutdown(MemTracker::NMT_normal);
546 546
547 if (VerifyStringTableAtExit) {
548 int fail_cnt = 0;
549 {
550 MutexLocker ml(StringTable_lock);
551 fail_cnt = StringTable::verify_and_compare_entries();
552 }
553
554 if (fail_cnt != 0) {
555 tty->print_cr("ERROR: fail_cnt=%d", fail_cnt);
556 guarantee(fail_cnt == 0, "unexpected StringTable verification failures");
557 }
558 }
559
547 #undef BEFORE_EXIT_NOT_RUN 560 #undef BEFORE_EXIT_NOT_RUN
548 #undef BEFORE_EXIT_RUNNING 561 #undef BEFORE_EXIT_RUNNING
549 #undef BEFORE_EXIT_DONE 562 #undef BEFORE_EXIT_DONE
550 } 563 }
551 564