Uploaded image for project: 'James Mime4j'
  1. James Mime4j
  2. MIME4J-174

Refactor org.mime4j.util.CharsetUtil to lazily determine supported encodings/decodings

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.7
    • None
    • None

    Description

      On initialization CharsetUtil determines all supported endcodings and decodings by attempting to encode and decode a dummy string with every entry in JAVA_CHARSETS. This loads a lot of classes into the JVM which in turn uses up a lot of permGen.

      Moving the decoding and encoding tests into isDecodingSupported() and isEncodingSupported() and adding positive results to the decodingSupported and encodingSupported treeSets from those methods would allow the class to only load encoders and decoders the application needs.

      Attachments

        1. charset_util_refactor.diff
          5 kB
          Richard von Keyserling

        Issue Links

          Activity

            People

              bago Stefano Bagnara
              rvonkeys Richard von Keyserling
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: