JDK-6545649 : user thread leak in java plugin
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows
  • CPU: x86
  • Submitted: 2007-04-12
  • Updated: 2010-04-04
  • Resolved: 2007-08-21
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
How to reproduce:

Launch page - http://sqindia.india.sun.com/~rn195728/BugVerification/6480378/CrashTextAreaApplet.html
Click the browser refresh/reload button many times quickly 

Observe the console, type 't' to list thread. There are user threads (Thream-nn in the applet threadgroup) leak.

Applet Code:
import java.applet.Applet;
import java.awt.TextArea;

public class CrashTextAreaApplet extends Applet
{

	TextArea ta;

    public CrashTextAreaApplet()
    {
        ta = new TextArea(20, 70);
    }

    public void init()
    {
        add(ta);
    }

    public void start()
    {
        Thread textWriter = new Thread() {

            public void run()
            {
                do
                    ta.append("Attempting crash Attempting crash Attempting crash Attempting crash Attempting crash \n");
                while(true);
            }
        };
        textWriter.start();
    }

    public void destroy()
    {
        ta.setText("");
    }

}

The textWriter thread launched from the applet is not correctly stopped when in page switch/reloading. Though the applet has the responsibilty to close whatever threads it creates, java plugin need a elegant way to clean up disposed applet contexts.

Comments
EVALUATION This is fixed under CR 6399750
21-08-2007