[vtkusers] VTK Crashing on allocating vtkData array - out of memory?

da remywendy at gmail.com
Wed Apr 7 16:57:15 EDT 2010


Hey guys,

My code is crashing after I make a large number of actors and contour filter
them all (80+ datasets with 40k points each and many data arrays). In visual
studios debugger, the

template <class T>
int vtkDataArrayTemplate<T>::Allocate(vtkIdType sz, vtkIdType)

is aborting from a malloc returning 0.

    this->Array = static_cast<T*>(malloc(static_cast<size_t>(newSize)
                                         * sizeof(T)));
    if(this->Array==0)
      {
      vtkErrorMacro("Unable to allocate " << newSize
                    << " elements of size " << sizeof(T)
                    << " bytes. ");
      #if !defined NDEBUG
      // We're debugging, crash here preserving the stack
      *abort();  *

This occurs after reading in the data and trying to render 80 contour
filters... Is this a result of my computer's memory limitation? In my
windows task manager, I see my application using about 900 MB of RAM when
the crash hits...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100407/dbb4c893/attachment.htm>


More information about the vtkusers mailing list