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

JTextComponent uses static Exception that causes perhaps bad memory leaks

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      swing1.1
    • CPU:
      generic
    • OS:
      generic

      Description

      Please see the attached java module representing a unit test for a jar class
      loader that demonstrates the problem.


      Some of the swing classes, for instance JTextComponent, store a static
      exption. This is a problem because Throwable will construct an Object
      containing a stack trace, which effectively prohibits any class on the call
      chain from being garbage collected, including our ClassLoader which ultimately
      leads to OutOfMemoryError's OUCH. Please use a new Throwable rather than static
      Throwable. Thanks to the JDK1.2 hat tool to get to the bottom of this problem!

      static final IllegalArgumentException illegalDocumentPosition =
              new IllegalArgumentException("Illegal document position");

        Attachments

          Activity

            People

            Assignee:
            tprinzinsunw Timothy Prinzing (Inactive)
            Reporter:
            duke J. Duke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: