# Inconsistent memory behavior in Catalyst

**URL:** https://discourse.paraview.org/t/inconsistent-memory-behavior-in-catalyst/2444
**Category:** ParaView Support
**Tags:** catalyst
**Created:** [August 16, 2019, 1:38pm UTC](https://discourse.paraview.org/t/inconsistent-memory-behavior-in-catalyst/2444 "2019-08-16T13:38:53Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![kschau](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/a5b964/32.png) [@kschau](https://discourse.paraview.org/u/kschau)
#### Post date: [September 28, 2019, 3:37pm UTC](https://discourse.paraview.org/t/inconsistent-memory-behavior-in-catalyst/2444/2 "2019-09-28T15:37:45Z")

</div>

For me, the solution to this problem was during the step of creating my grid. In many of the Catalyst examples, the “points” array is created by just inserting the next point sequentially.

Apparently, when this method is used, vtk will double the allocated memory each time it runs out and you ask to insert next point. If you have a large data set, this gets out of control very fast and my above error was thrown.

Solution was just to be explicit (as usual) with memory allocation in the form of

vtkSmartPointer points = vtkPoints::New();  
points-\>Allocate(static\_cast(\*nx \* \*ny \* \*nz));

hope this helps someone else out.

---

_[View the full topic](https://discourse.paraview.org/t/inconsistent-memory-behavior-in-catalyst/2444)._
