Details

    • Type: Bug
    • Status: Closed
    • Priority: P1
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.1.6
    • Fix Version/s: None
    • Component/s: client-libs
    • Subcomponent:
    • CPU:
      x86
    • OS:
      solaris_2.6

      Description

      The following code shows the memory leak.

      /**
       * A simple test program that demonstrates that there are mmory leaks
       * when creating new frames under JDK1.1.6
       *
       * We could watch the process size grows consistantly with the command:
       *
       * while true; do ps -orss,osz, -p thePid; sleep 2; done;
       *
       * finally the JVM will crash.
       *
       */

      import java.awt.*;
      import java.awt.event.*;

      public class FrameTest extends Frame implements Runnable, ActionListener{
          Frame f;
          int number = 0;

          public static void main (String args[]){
              FrameTest aTest = new FrameTest();
          }

          public FrameTest (){
              Button b = new Button("test");
              b.addActionListener(this);
              this.add(b);
              pack();
              this.setVisible(true);
          }

          public synchronized void actionPerformed( ActionEvent e ) {
              Thread aThread = new Thread(this);
              aThread.start();
          }

          public void run()
          {
              for (int i = 0; i < 50000; i++) {
                  number = number + 1;
           System.out.println("number= " + number);
                  f = new Frame();
                  f.setSize(300,100);
                  f.setVisible(true);

                  try{
        Thread.currentThread().sleep(25);
           }catch(InterruptedException e){;}

                  f.setVisible(false);
                  f.dispose();
                  f=null;
              }
          }
      }

        Attachments

          Activity

            People

            • Assignee:
              bchristi Brent Christian
              Reporter:
              arajadur Angelo Rajadurai
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: