Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8315238

String interning may repeatedly start string deduplication

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • 25
    • 22
    • hotspot
    • gc

      When string deduplication is in progress, and the application interns a string, this interning causes another string deduplication round.

      StringDedup::Processor::wait_for_requests() has the following code:

          while ((storage->allocation_count() == 0) &&
                 !Table::is_dead_entry_removal_needed()) {
            ml.wait();
          }

      and string interning may increase the allocation count, which results in the Processor skipping the notification wait.

      Particularly with stringdedup logging on, this can cause many consecutive (seen up to 6) string dedup rounds that fill up the log (in addition to the cpu time taken).

      This does not seem deliberate as if/when the string dedup thread is already waiting in the shown code (in ml.wait), string interning will basically never cause additional string dedup rounds.

      Reproducable with the gc/stringdedup/TestStringDeduplicationYoungGC.java test, although not to the extent described here.

            Unassigned Unassigned
            tschatzl Thomas Schatzl
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: