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

(se) Selector implementations do unnecessary object allocation and boxing due to fdToKey map

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      ADDITIONAL SYSTEM INFORMATION :
      It happens on all OSes, Java 11.0.3, but earlier and later versions also exhibit this behavior.

      A DESCRIPTION OF THE PROBLEM :
      EPollSelectorImpl.processEvents does unnecessary boxing when looking up the selector key on fdToKey. On a particular workload, it allocates over 150GB in a 20 minute period.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Any app that does heavy use of NIO selectors. For example Apache Ignite.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Avoid the unnecessary allocations. Use a map keyed by a primitive int.
      ACTUAL -
      ~80 of boxing induced allocations are triggered by EPollSelectorImpl

      FREQUENCY : always


        Attachments

          Activity

            People

            • Assignee:
              alanb Alan Bateman
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: