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

StandardCharsets.charsetForName method causes perforance bottlenecks

XMLWordPrintable

      ADDITIONAL SYSTEM INFORMATION :
      Running on RedHat linux system

      A DESCRIPTION OF THE PROBLEM :
      Multithreaded application is observing performance degradation due to threads blocking within StandardCharsets.charsetForName method on the synchronized block
      ```
       public final Charset charsetForName(String charsetName) {
              synchronized (this) {
                  return lookup(canonicalize(charsetName));
              }
          }
      ```

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run a multithraded application that consumes StandardCharsets.charsetForName( with around 200+ threads with CPU utilization around 85+%. Profile this application

      I was running a load generation application. When I tried to increase the load by delta, the load generator application crashed and did not recover.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The load generated by system should increase.
      ACTUAL -
      The load generator crashed and did not recover.
      All the code paths consuming StandardCharsets.charsetForName( show blocked threads

      FREQUENCY : always


            naoto Naoto Sato
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: