public class testthread {
public static void main(String[] args) {
/*
* threadmem t1 = new threadmem(); int i = 0; for(i =0 ;i< 1000000; i++)
* { new Thread(t1).start(); }
*/
try {
while (true) {
threadmem t1 = new threadmem();
t1.start();
System.gc();
Thread.sleep(10);
}
} catch (Throwable e) {
e.printStackTrace();
}
}
}
class threadmem extends Thread// implements Runnable
{
static int i = 0;
public void run() {
try {
System.out.println("i="+ i++);
StringBuffer st1 = new StringBuffer(11250000);
//Thread.sleep(100000);
} catch (Throwable e) {
e.printStackTrace();
}
}
protected void finalize()
throws Throwable
{
System.out.println(1111);
}
}