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

Store PermissionCollection entries in a ConcurrentHashMap instead of a HashMap in Permissions class

XMLWordPrintable

        Currently, the code has several synchronized blocks around get/put operations to the HashMap. The policy provider caches a Permissions object per ProtectionDomain, so this can easily become a thread contention point when multiple threads are checking permissions.

        My benchmark with 8 threads which tests the performance of implies against a Permissions object containing a collection of different Permission objects shows about a 2x throughput improvement of Permissions.implies after I made this change. Prior to my change, a profiler showed that Permissions.implies was blocked 72% of the time. Afterwards, 0 %.

              mullan Sean Mullan
              mullan Sean Mullan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: