MCPcopy Create free account
hub / github.com/Kitware/VTK / main

Method main

Wrapping/Java/Testing/Java/vtk/test/JavaGCAndDelete.java:15–41  ·  view source on GitHub ↗
(final String[] args)

Source from the content-addressed store, hash-verified

13public 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}

Callers

nothing calls this directly

Calls 9

ExitMethod · 0.80
DeleteMethod · 0.65
gcMethod · 0.65
InitializeMethod · 0.45
SetInputConnectionMethod · 0.45
GetOutputPortMethod · 0.45
SetMapperMethod · 0.45
GetOutputMethod · 0.45

Tested by

no test coverage detected