[vtk-developers] Garbage collection slowness

Brad King brad.king at kitware.com
Wed May 14 13:57:13 EDT 2008


Hank Childs wrote:
> 
> Hi Brad,
> 
> I really appreciate you taking some time to take a look.
> 
> It looks like it made the deletes better.  But it still seems like there
> is something really wrong going on ... but you can only see it if you go
> past j=0.  I changed the "amt" from 25K to 10K and kept j at 10.
> 
> With your changes, the last iteration of the norm filter takes 52.3s.  I
> believe it should only take as long as the first iteration, which is
> ~3s.  Without your changes, the last iteration takes 17.0s (not quite as
> bad, but there is still a problem).  I wonder if this is related to all
> of the vtkInformation's floating around.  I tried taking them out, but
> that led to crashes, warnings, etc.
> 
> Any thoughts?

Just in case, try making sure you free the "norm" filter each time.
Currently it is being leaked.  Also, for cleanliness free the last set
of outputs:

@@ -57,10 +67,15 @@ int main()
             outputs[i]->Delete();
             outputs[i] = outputs2[i];
         }
+        norm->Delete();
         vtkTimerLog::MarkEndEvent("Delete");
     }

     ofstream ofile("timings");
     vtkTimerLog::DumpLogWithIndents( &ofile, 0);
+
+    for (i = 0 ; i < amt ;i++)
+      outputs[i]->Delete();
+    return 0;
 }

-Brad




More information about the vtk-developers mailing list