<div>Hi,</div><div><br></div><div>I m working with pretty large vtkPolyData on a x64 machine</div><div>(more than 201 326 592 points, vtk 5.6.1)</div><div><br></div><div>When i try to add a new point (201 326 593th) with InsertNextPoint it calls the </div>

<div>vtkDataArrayTemplate&lt;&gt;::ResizeAndExtend  and</div><div>tries to allocate 402 653 181 points, which is just impossible.</div><div>(allocation of floats, 3 floats per point)</div><div><br></div><div>I understand that for small arrays it is good to allocate each time &#39;double&#39; the memory</div>

<div>when resizing an array but when we reach very large dataset, it seems a little bit too much, isn&#39;it ?</div><div><br></div><div>Do you plan to modify that ? </div><div><br></div><div>Thanks a lot!</div><div>Benoit</div>

<div><br></div><div>PS: i extracted the code of vtkDataArrayTemplate  :</div><div><br></div><div>------------------------------- CODE of vtkDataArrayTemplate -------------------------------</div><div><br></div><div>template &lt;class T&gt;T* vtkDataArrayTemplate&lt;T&gt;::ResizeAndExtend(vtkIdType sz)</div>

<div>{</div><div>  T* newArray;</div><div>  vtkIdType newSize;</div><div><br></div><div>  if(sz &gt; this-&gt;Size) </div><div>    {</div><div>    // Requested size is bigger than current size.  Allocate enough</div><div>

    // memory to fit the requested size and be more than double the</div><div>    // currently allocated memory.</div><div>    newSize = this-&gt;Size + sz;                      // &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; SEE HERE</div>

<div>    }</div><div>  else if (sz == this-&gt;Size)</div><div>    {</div><div>    // Requested size is equal to current size.  Do nothing.</div><div>    return this-&gt;Array;</div><div>    }</div><div>  else</div><div>
    {</div>
<div>    // Requested size is smaller than current size.  Squeeze the</div><div>    // memory.</div><div>    newSize = sz;</div><div>    this-&gt;DataChanged();</div><div>    }</div><div><br></div><div>  // Wipe out the array completely if new size is zero.</div>

<div>  if(newSize &lt;= 0)</div><div>    {</div><div>    this-&gt;Initialize();</div><div>    return 0;</div><div>    }</div>