Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-262

Use of enum prevents a classloader from being garbage collected resuling in out of memory exceptions.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • None
    • 2.3
    • None
    • None
    • All

    Description

      When an enum is created it is placed in the static hashmap - cEnumClasses. If the enum is created from a classloader which has a limited lifetime then due to the strong reference the classloader is never garbage collected resulting in a memory leak.

      I believe that making the cEnumClasses a WeakHashMap should resolve the problem.

      Attachments

        1. ClassMapping.java
          2 kB
          Henri Yandell

        Activity

          People

            Unassigned Unassigned
            neilredway Neil Redway
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: