Dear all,<br>I have a program to display about 50,000 spheres. It doesn&#39;t take too much time to display them(about 2 second), however, when I close the program, which will first delete all the actors, it takes a very long time(about 30 seconds). When I debug the code, I found that everytime I pause the debug, the program stops somewhere shown in the call stack attached below. It seems that the program spends a lot of time in garbage collection, which I&#39;m not quite clear how it works. Could anybody tell me how can I speed up the deleting actors, or at which direction I should look at. Any suggetion will be appreciated.<br>
<br>Best regards<br>Yang<br><blockquote>
</blockquote>     std::_Iterator_base::_Orphan_me()    C++<br>     std::_Iterator_base::~_Iterator_base()    C++<br>     std::_Bidit&lt;vtkGarbageCollectorImpl::Entry *,int,vtkGarbageCollectorImpl::Entry * const *,vtkGarbageCollectorImpl::Entry * const &amp;&gt;::~_Bidit&lt;vtkGarbageCollectorImpl::Entry *,int,vtkGarbageCollectorImpl::Entry * const *,vtkGarbageCollectorImpl::Entry * const &amp;&gt;()    C++<br>
     std::_Tree&lt;std::_Tset_traits&lt;vtkGarbageCollectorImpl::Entry *,vtkGarbageCollectorImpl::EntryCompare,std::allocator&lt;vtkGarbageCollectorImpl::Entry *&gt;,0&gt; &gt;::const_iterator::~const_iterator()    C++<br>
     std::_Tree&lt;std::_Tset_traits&lt;vtkGarbageCollectorImpl::Entry *,vtkGarbageCollectorImpl::EntryCompare,std::allocator&lt;vtkGarbageCollectorImpl::Entry *&gt;,0&gt; &gt;::iterator::~iterator()    C++<br>     std::_Tree&lt;std::_Tset_traits&lt;vtkGarbageCollectorImpl::Entry *,vtkGarbageCollectorImpl::EntryCompare,std::allocator&lt;vtkGarbageCollectorImpl::Entry *&gt;,0&gt; &gt;::insert(vtkGarbageCollectorImpl::Entry * const &amp;)    C++<br>
     vtkGarbageCollectorImpl::VisitTarjan(vtkObjectBase *)    C++<br>     vtkGarbageCollectorImpl::MaybeVisit(vtkObjectBase *)    C++<br>     vtkGarbageCollectorImpl::Report(vtkObjectBase *, void *)    C++<br>     vtkGarbageCollectorImpl::Report(vtkObjectBase *, void *, const char *)    C++<br>
     vtkGarbageCollectorReportInternal(vtkGarbageCollector *, vtkObjectBase *, void *, const char *)    C++<br>     vtkGarbageCollectorReport&lt;vtkInformation&gt;(vtkGarbageCollector *, vtkInformation * &amp;, const char *)    C++<br>
     vtkDataObject::ReportReferences(vtkGarbageCollector *)    C++<br>     vtkPointSet::ReportReferences(vtkGarbageCollector *)    C++<br>     vtkGarbageCollectorToObjectBaseFriendship::ReportReferences(vtkGarbageCollector *, vtkObjectBase *)    C++<br>
     vtkGarbageCollectorImpl::VisitTarjan(vtkObjectBase *)    C++<br>     vtkGarbageCollectorImpl::MaybeVisit(vtkObjectBase *)    C++<br>     vtkGarbageCollectorImpl::Report(vtkObjectBase *, void *)    C++<br>     vtkGarbageCollectorImpl::Report(vtkObjectBase *, void *, const char *)    C++<br>
     vtkGarbageCollectorReportInternal(vtkGarbageCollector *, vtkObjectBase *, void *, const char *)    C++<br>     vtkGarbageCollectorReport&lt;vtkPolyData&gt;(vtkGarbageCollector *, vtkPolyData * &amp;, const char *)    C++<br>
     vtkPrimitivePainter::ReportReferences(vtkGarbageCollector *)    C++<br>     vtkGarbageCollectorToObjectBaseFriendship::ReportReferences(vtkGarbageCollector *, vtkObjectBase *)    C++<br>     vtkGarbageCollectorImpl::VisitTarjan(vtkObjectBase *)    C++<br>
     vtkGarbageCollectorImpl::MaybeVisit(vtkObjectBase *)    C++<br>     vtkGarbageCollectorImpl::Report(vtkObjectBase *, void *)    C++<br>     vtkGarbageCollectorImpl::Report(vtkObjectBase *, void *, const char *)    C++<br>
     vtkGarbageCollectorReportInternal(vtkGarbageCollector *, vtkObjectBase *, void *, const char *)    C++<br>     vtkGarbageCollectorReport&lt;vtkPolyDataPainter&gt;(vtkGarbageCollector *, vtkPolyDataPainter * &amp;, const char *)    C++<br>
     vtkChooserPainter::ReportReferences(vtkGarbageCollector *)    C++<br>     vtkGarbageCollectorToObjectBaseFriendship::ReportReferences(vtkGarbageCollector *, vtkObjectBase *)    C++<br>     vtkGarbageCollectorImpl::VisitTarjan(vtkObjectBase *)    C++<br>
     vtkGarbageCollectorImpl::MaybeVisit(vtkObjectBase *)    C++<br>     vtkGarbageCollectorImpl::Report(vtkObjectBase *, void *)    C++<br>     vtkGarbageCollectorImpl::Report(vtkObjectBase *, void *, const char *)    C++<br>
     vtkGarbageCollectorReportInternal(vtkGarbageCollector *, vtkObjectBase *, void *, const char *)    C++<br>     vtkGarbageCollectorReport&lt;vtkPainter&gt;(vtkGarbageCollector *, vtkPainter * &amp;, const char *)    C++<br>
     vtkPainter::ReportReferences(vtkGarbageCollector *)    C++<br>     vtkGarbageCollectorToObjectBaseFriendship::ReportReferences(vtkGarbageCollector *, vtkObjectBase *)    C++<br>     vtkGarbageCollectorImpl::VisitTarjan(vtkObjectBase *)    C++<br>
     vtkGarbageCollectorImpl::MaybeVisit(vtkObjectBase *)    C++<br>     vtkGarbageCollectorImpl::Report(vtkObjectBase *, void *)    C++<br>     vtkGarbageCollectorImpl::Report(vtkObjectBase *, void *, const char *)    C++<br>
     vtkGarbageCollectorReportInternal(vtkGarbageCollector *, vtkObjectBase *, void *, const char *)    C++<br>     vtkGarbageCollectorReport&lt;vtkPainter&gt;(vtkGarbageCollector *, vtkPainter * &amp;, const char *)    C++<br>
     vtkPainter::ReportReferences(vtkGarbageCollector *)    C++<br>     vtkGarbageCollectorToObjectBaseFriendship::ReportReferences(vtkGarbageCollector *, vtkObjectBase *)    C++<br>     vtkGarbageCollectorImpl::VisitTarjan(vtkObjectBase *)    C++<br>
     vtkGarbageCollectorImpl::MaybeVisit(vtkObjectBase *)    C++<br>     vtkGarbageCollectorImpl::Report(vtkObjectBase *, void *)    C++<br>     vtkGarbageCollectorImpl::Report(vtkObjectBase *, void *, const char *)    C++<br>
     vtkGarbageCollectorReportInternal(vtkGarbageCollector *, vtkObjectBase *, void *, const char *)    C++<br>     vtkGarbageCollectorReport&lt;vtkPainter&gt;(vtkGarbageCollector *, vtkPainter * &amp;, const char *)    C++<br>
     vtkPainter::ReportReferences(vtkGarbageCollector *)    C++<br>     vtkGarbageCollectorToObjectBaseFriendship::ReportReferences(vtkGarbageCollector *, vtkObjectBase *)    C++<br>     vtkGarbageCollectorImpl::VisitTarjan(vtkObjectBase *)    C++<br>
     vtkGarbageCollectorImpl::MaybeVisit(vtkObjectBase *)    C++<br>     vtkGarbageCollectorImpl::Report(vtkObjectBase *, void *)    C++<br>     vtkGarbageCollectorImpl::Report(vtkObjectBase *, void *, const char *)    C++<br>
     vtkGarbageCollectorReportInternal(vtkGarbageCollector *, vtkObjectBase *, void *, const char *)    C++<br>     vtkGarbageCollectorReport&lt;vtkPainter&gt;(vtkGarbageCollector *, vtkPainter * &amp;, const char *)    C++<br>
     vtkPainter::ReportReferences(vtkGarbageCollector *)    C++<br>     vtkCompositePainter::ReportReferences(vtkGarbageCollector *)    C++<br>     vtkGarbageCollectorToObjectBaseFriendship::ReportReferences(vtkGarbageCollector *, vtkObjectBase *)    C++<br>
     vtkGarbageCollectorImpl::VisitTarjan(vtkObjectBase *)    C++<br>     vtkGarbageCollectorImpl::MaybeVisit(vtkObjectBase *)    C++<br>     vtkGarbageCollectorImpl::Report(vtkObjectBase *, void *)    C++<br>     vtkGarbageCollectorImpl::Report(vtkObjectBase *, void *, const char *)    C++<br>
     vtkGarbageCollectorReportInternal(vtkGarbageCollector *, vtkObjectBase *, void *, const char *)    C++<br>     vtkGarbageCollectorReport&lt;vtkPainter&gt;(vtkGarbageCollector *, vtkPainter * &amp;, const char *)    C++<br>
     vtkPainter::ReportReferences(vtkGarbageCollector *)    C++<br>     vtkGarbageCollectorToObjectBaseFriendship::ReportReferences(vtkGarbageCollector *, vtkObjectBase *)    C++<br>     vtkGarbageCollectorImpl::VisitTarjan(vtkObjectBase *)    C++<br>
     vtkGarbageCollectorImpl::MaybeVisit(vtkObjectBase *)    C++<br>     vtkGarbageCollectorImpl::Report(vtkObjectBase *, void *)    C++<br>     vtkGarbageCollectorImpl::Report(vtkObjectBase *, void *, const char *)    C++<br>
     vtkGarbageCollectorReportInternal(vtkGarbageCollector *, vtkObjectBase *, void *, const char *)    C++<br>     vtkGarbageCollectorReport&lt;vtkPainter&gt;(vtkGarbageCollector *, vtkPainter * &amp;, const char *)    C++<br>
     vtkPainter::ReportReferences(vtkGarbageCollector *)    C++<br>     vtkGarbageCollectorToObjectBaseFriendship::ReportReferences(vtkGarbageCollector *, vtkObjectBase *)    C++<br>     vtkGarbageCollectorImpl::VisitTarjan(vtkObjectBase *)    C++<br>
     vtkGarbageCollectorImpl::MaybeVisit(vtkObjectBase *)    C++<br>     vtkGarbageCollectorImpl::Report(vtkObjectBase *, void *)    C++<br>     vtkGarbageCollectorImpl::Report(vtkObjectBase *, void *, const char *)    C++<br>
     vtkGarbageCollectorReportInternal(vtkGarbageCollector *, vtkObjectBase *, void *, const char *)    C++<br>     vtkGarbageCollectorReport&lt;vtkPainter&gt;(vtkGarbageCollector *, vtkPainter * &amp;, const char *)    C++<br>
     vtkPainter::ReportReferences(vtkGarbageCollector *)    C++<br>     vtkScalarsToColorsPainter::ReportReferences(vtkGarbageCollector *)    C++<br>     vtkGarbageCollectorToObjectBaseFriendship::ReportReferences(vtkGarbageCollector *, vtkObjectBase *)    C++<br>
     vtkGarbageCollectorImpl::VisitTarjan(vtkObjectBase *)    C++<br>     vtkGarbageCollectorImpl::MaybeVisit(vtkObjectBase *)    C++<br>     vtkGarbageCollectorImpl::Report(vtkObjectBase *, void *)    C++<br>     vtkGarbageCollectorImpl::Report(vtkObjectBase *, void *, const char *)    C++<br>
     vtkGarbageCollectorReportInternal(vtkGarbageCollector *, vtkObjectBase *, void *, const char *)    C++<br>     vtkGarbageCollectorReport&lt;vtkPainter&gt;(vtkGarbageCollector *, vtkPainter * &amp;, const char *)    C++<br>
     vtkPainter::ReportReferences(vtkGarbageCollector *)    C++<br>     vtkDefaultPainter::ReportReferences(vtkGarbageCollector *)    C++<br>     vtkGarbageCollectorToObjectBaseFriendship::ReportReferences(vtkGarbageCollector *, vtkObjectBase *)    C++<br>
     vtkGarbageCollectorImpl::VisitTarjan(vtkObjectBase *)    C++<br>     vtkGarbageCollectorImpl::MaybeVisit(vtkObjectBase *)    C++<br>     vtkGarbageCollectorImpl::Report(vtkObjectBase *, void *)    C++<br>     vtkGarbageCollectorImpl::Report(vtkObjectBase *, void *, const char *)    C++<br>
     vtkGarbageCollectorReportInternal(vtkGarbageCollector *, vtkObjectBase *, void *, const char *)    C++<br>     vtkGarbageCollectorReport&lt;vtkPainter&gt;(vtkGarbageCollector *, vtkPainter * &amp;, const char *)    C++<br>
     vtkPainterPolyDataMapper::ReportReferences(vtkGarbageCollector *)    C++<br>     vtkGarbageCollectorToObjectBaseFriendship::ReportReferences(vtkGarbageCollector *, vtkObjectBase *)    C++<br>     vtkGarbageCollectorImpl::VisitTarjan(vtkObjectBase *)    C++<br>
     vtkGarbageCollectorImpl::MaybeVisit(vtkObjectBase *)    C++<br>     vtkGarbageCollectorImpl::FindComponents(vtkObjectBase *)    C++<br>     vtkGarbageCollectorImpl::CollectInternal(vtkObjectBase *)    C++<br>     vtkGarbageCollector::Collect(vtkObjectBase *)    C++<br>
     vtkObjectBase::UnRegisterInternal(vtkObjectBase *, int)    C++<br>     vtkObject::UnRegisterInternal(vtkObjectBase *, int)    C++<br>     vtkAlgorithm::UnRegister(vtkObjectBase *)    C++<br>     vtkActor::~vtkActor()    C++<br>
     vtkOpenGLActor::~vtkOpenGLActor()    C++<br>     vtkOpenGLActor::`vector deleting destructor&#39;()    C++<br>     vtkObjectBase::UnRegisterInternal(vtkObjectBase *, int)    C++<br>     vtkObject::UnRegisterInternal(vtkObjectBase *, int)    C++<br>
     vtkObjectBase::UnRegister(vtkObjectBase *)    C++<br>     vtkObjectBase::Delete()    C++<br><br>