Uploaded image for project: 'Openfire (ARCHIVED)'
  1. Openfire (ARCHIVED)
  2. JM-1453

JID class cache should not use one single mutex to synchronize all access on.

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.1
    • Component/s: Core
    • Labels:
      None

      Description

      The org.xmpp.packet.JID class contains a static Cache called stringprepCache. Access to this class is synchronized by having the cache be wrapped like this:

      private static Map<String,Object> stringprepCache = Collections.synchronizedMap(new Cache(10000));

      The Collections.synchronizedMap() method applies very simple synchronization, by simply synchronizing every action (even stuff like contains()) on one single mutex.

      In a multithreaded environment, such as Openfire, this will significantly affect performance, as no more thread can access the cache at any given time.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              gaston Gaston Dombiak
              Reporter:
              guus Guus der Kinderen
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: