(final String[] args)
| 13 | public class JavaGCAndDelete { |
| 14 | |
| 15 | public static void main(final String[] args) { |
| 16 | vtkJavaTesting.Initialize(args); |
| 17 | long timeout = System.currentTimeMillis() + 60000; // +1 minute |
| 18 | int i = 0; |
| 19 | int k = 0; |
| 20 | while (System.currentTimeMillis() < timeout) { |
| 21 | final vtkArrowSource arrowSource = new vtkArrowSource(); |
| 22 | final vtkPolyDataMapper mapper = new vtkPolyDataMapper(); |
| 23 | mapper.SetInputConnection(arrowSource.GetOutputPort()); |
| 24 | final vtkActor actor = new vtkActor(); |
| 25 | actor.SetMapper(mapper); |
| 26 | |
| 27 | arrowSource.GetOutput().Delete(); |
| 28 | arrowSource.Delete(); |
| 29 | mapper.Delete(); |
| 30 | actor.Delete(); |
| 31 | |
| 32 | ++i; |
| 33 | if (i >= 10000) { |
| 34 | ++k; |
| 35 | System.out.println(vtkObject.JAVA_OBJECT_MANAGER.gc(true).listKeptReferenceToString()); |
| 36 | System.out.println(k * 10000); |
| 37 | i = 0; |
| 38 | } |
| 39 | } |
| 40 | vtkJavaTesting.Exit(vtkJavaTesting.PASSED); |
| 41 | } |
| 42 | |
| 43 | } |
nothing calls this directly
no test coverage detected