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

Unstarted Thread causes memory leak

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 1.3.0
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description



      Name: krC82822 Date: 02/01/2001


      01 Feb 2001, eval1127@eng -- this is apparently related to # 4229558.
      However, that bug's synopsis is stated in terms of an inconsistency
      between 1.1.x and Java 2, and is thus hard for users to quickly
      find/identify the underlying problem on the Bug Parade.
      Am opening a separate bug purely for tracking purposes (will dupe to
      #4229558)
      -------------
      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

      Threads that are not started cause a memory leak, and are never garbage
      collected even if they have no pointers referencing them.
      The following code will show this, I used OptimizeIt 4.0 to determine this
      memory leak.

      public class ThreadTest {

        
          public static void main(String args[]) {
      while (true) {
      try {
              Thread t = new Thread();
      // start thread for memory leak workaround
      // t.start();
      t = null;
              System.gc();
      Thread.sleep(500);
      } catch (InterruptedException ie) {
      ie.printStackTrace();
      }
              }
          }

      }
      (Review ID: 116183)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                kryansunw Kevin Ryan (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: