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

Unnecessary object creation in MediaTypeHelper

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Done
    • Trivial
    • 3.5.0.CR1, 4.0.0.Beta2
    • 3.1.4.Final
    • jaxrs
    • None

    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
      

      Attachments

        Activity

          People

            rhn-support-asoldano Alessio Soldano
            lstosik Ɓukasz Stosik (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: