Bug #7190 » leakConst.java
1 |
|
---|---|
2 |
import ptolemy.actor.CompositeActor; |
3 |
import ptolemy.actor.lib.Const; |
4 |
import ptolemy.kernel.util.Workspace; |
5 |
|
6 |
public class leakConst { |
7 |
|
8 |
public static void main(String[] args) { |
9 |
|
10 |
leakConst l = new leakConst(); |
11 |
l.go(); |
12 |
|
13 |
}
|
14 |
|
15 |
public void go() { |
16 |
|
17 |
try { |
18 |
CompositeActor master = new CompositeActor(); |
19 |
Const myConst = new Const(master, "const"); |
20 |
|
21 |
for(int i = 0; i < 100; i++) { |
22 |
master.clone(new Workspace()); |
23 |
}
|
24 |
|
25 |
System.gc(); |
26 |
|
27 |
System.out.println("Sleeping..."); |
28 |
Thread.sleep(100000L); |
29 |
} catch(Throwable t) { |
30 |
System.err.println("caught: " + t); |
31 |
}
|
32 |
}
|
33 |
|
34 |
}
|