Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-1773

Unnecessary object creation in MediaTypeHelper

    Details

      Description

      MediaTypeHelper creates new instance of MediaTypeComparator for every invocation of method using it. The comparator is collected by minor GC but is very noticeable in `jmap -histo`:

      num     #instances         #bytes  class name
      ----------------------------------------------
         1:       9792214     1319679080  [C
         2:       3527801      548777072  [B
         3:       4015784      283789264  [Ljava.lang.Object;
         4:       1535314      236687048  [I
         5:       6324191      151780584  java.lang.String
         6:       4591782      146937024  java.util.HashMap$Node
         7:       7942616      127081856  org.jboss.resteasy.util.MediaTypeHelper$MediaTypeComparator
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                asoldano Alessio Soldano
                Reporter:
                lstosik Ɓukasz Stosik
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: