Bug 73691 - Many processes of javaw.exe reside in the memory and never disappear
Summary: Many processes of javaw.exe reside in the memory and never disappear
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M2   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-10 14:14 EDT by Hong-Hui Chen CLA
Modified: 2004-10-27 07:00 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hong-Hui Chen CLA 2004-09-10 14:14:42 EDT
I wrote a simple program with GUI. Ever time I run the program and close it, 
the invoked VM, javaw.exe, still keep alive in the memory.  These processes of 
javaw.exe won't be terminated until the Eclipse is closed.  The JDK I 
installed is jdk1.5.0.  The program I wrote as follows:

//-----------------------------------------------------------------------------
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;

public class MyFrame extends JFrame implements ActionListener{
	private JButton button;
	private JLabel label;
	private String name[]={"A","B","C","D"};
	private int idx;
	
	public MyFrame(){		
		super("Test it!");
		
		idx=0;		
		Container c=getContentPane();
		c.setLayout(new FlowLayout(FlowLayout.CENTER));
		label=new JLabel(name[idx]);
		button=new JButton("push me!");
		label.setToolTipText("I am tips!");
		c.add(label);
		c.add(button);
		setSize(800,600);
		setVisible(true);
		button.addActionListener(this);
	}
	
	public static void main(String args[]){
		MyFrame app=new MyFrame();		
	}

	public void actionPerformed(ActionEvent e) {
		if(idx==3)
			idx=0;
		else
			idx++;
		
		label.setText(name[idx]);
		repaint();
	}
	
}

//-----------------------------------------------------------------------------
These processes of javaw.exe do slow down my computer a lot because they 
consume too much memory.
Comment 1 Olivier Thomann CLA 2004-09-10 17:49:58 EDT
This has nothing to do with Eclipse. You have the UI thread that is running and
therefore the program won't exit as long as it is running. You would have the
same problem running from the command line.
You need to exit when the frame is closed.
Close as INVALID.