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

Component class leaks a Graphics object

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.1
    • 1.1
    • client-libs
    • None
    • 1.1fcs
    • sparc
    • solaris_2.5.1
    • Not verified

      The following code from Component.getGraphics() needs to be changed:

      if (peer instanceof java.awt.peer.LightweightPeer) {
      Graphics g = parent.getGraphics();
      return g.create(x, y, width, height);
      } else {
      ...

      The original g object was never disposed. We will have to wait
      an indeterminate amount of time for those resources to be reclaimed
      through garbage collection.

      At best, this is creating an extra object unnecessarily. At worst,
      this ties up system resources leading to abnormally high memory
      usage or even failure due to depleted resources.

            tprinzing Tim Prinzing (Inactive)
            flar Jim Graham
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: