Bug #7190 » leak.java
1 |
|
---|---|
2 |
import ptolemy.actor.CompositeActor; |
3 |
import ptolemy.actor.lib.Ramp; |
4 |
import ptolemy.kernel.util.Workspace; |
5 |
|
6 |
public class leak { |
7 |
|
8 |
public static void main(String[] args) { |
9 |
|
10 |
leak l = new leak(); |
11 |
l.go(); |
12 |
|
13 |
}
|
14 |
|
15 |
public void go() { |
16 |
|
17 |
try { |
18 |
CompositeActor master = new CompositeActor(); |
19 |
Ramp ramp = new Ramp(master, "ramp"); |
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 |
}
|