[vtkusers] VTK and Java Wrappers

Lars Matthäus lars.matthaeus at web.de
Thu Mar 25 03:57:05 EDT 2010


Add-on: If I run the same program (without vtkGlobalJavaHash.GC() and
without .Delete on the vtk objects) using the globalLock solution
proposed before it runs for days without crashing or running out of
memory. Hence I vote again for using the globalLock implementation in
vtk5.6.

Lars

Am 25.03.2010 08:36, schrieb Lars Matthäus:
> Dear Jeff,
> 
> I tested your solution, but I can't get it to work; either I have a
> memory leak or a crash (or both). I have the following small test
> program (see attachment for full compiling program):
> 
> int i = 0;
> int k = 0;
> while (true) {
> 
> 	final vtkArrowSource arrowSource = new vtkArrowSource();
> 	final vtkPolyDataMapper mapper = new vtkPolyDataMapper();
> 	mapper.SetInput(arrowSource.GetOutput());
> 	final vtkActor actor = new vtkActor();
> 	actor.SetMapper(mapper);
> 
> 	arrowSource.Delete();
> 	mapper.Delete();
> 	actor.Delete();
> 
> 	++i;
> 	if (i >= 10000) {
> 		++k;
> 		vtkGlobalJavaHash.GC();
> 		System.out.println("" + k * 10000);
> 		i = 0;
> 	}
> }



More information about the vtkusers mailing list