<div dir="ltr">The memory footprint of the input polydata isn't really important here, rather it's the bounds of the input dataset that are determining the size of the output in this example.<br><br>What's the value of the dims arg? That's what is ultimately determining the size of this array.<br><br>From the linked code, the final size of the output scalar array will be<div><br>(dims[0] + 2) * (dims[1] + 2) * (dims[2] + 2)</div><div><br></div><div>bytes for uchar scalars. You likely want to reduce the resolution of the spacing parameters based on the input bounds to keep the size manageable.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 17, 2018 at 10:49 AM, vacingforo <span dir="ltr"><<a href="mailto:vacingforo@gmail.com" target="_blank">vacingforo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
This is the evolution of the memory which is included in the main.cpp posted<br>
link:<br>
The memory change from:<br>
<br>
There is       62 percent of memory in use to There is       93 percent of<br>
memory in use.<br>
<br>
Output program:<br>
<br>
Start...<br>
There is       62 percent of memory in use.<br>
There are 8061184 total KB of physical memory.<br>
There are 3050704 free  KB of physical memory.<br>
There are 16171740 total KB of paging file.<br>
There are 3346076 free  KB of paging file.<br>
There are 4194176 total KB of virtual memory.<br>
There are 4044480 free  KB of virtual memory.<br>
There are       0 free  KB of extended memory.<br>
There is       62 percent of memory in use.<br>
There are 8061184 total KB of physical memory.<br>
There are 3050404 free  KB of physical memory.<br>
There are 16171740 total KB of paging file.<br>
There are 3346076 free  KB of paging file.<br>
There are 4194176 total KB of virtual memory.<br>
There are 4044480 free  KB of virtual memory.<br>
There are       0 free  KB of extended memory.<br>
There is       62 percent of memory in use.<br>
There are 8061184 total KB of physical memory.<br>
There are 3050276 free  KB of physical memory.<br>
There are 16171740 total KB of paging file.<br>
There are 2598940 free  KB of paging file.<br>
There are 4194176 total KB of virtual memory.<br>
There are 3293492 free  KB of virtual memory.<br>
There are       0 free  KB of extended memory.<br>
There is       70 percent of memory in use.<br>
There are 8061184 total KB of physical memory.<br>
There are 2370144 free  KB of physical memory.<br>
There are 16171740 total KB of paging file.<br>
There are 2620368 free  KB of paging file.<br>
There are 4194176 total KB of virtual memory.<br>
There are 3293492 free  KB of virtual memory.<br>
There are       0 free  KB of extended memory.<br>
There is       84 percent of memory in use.<br>
There are 8061184 total KB of physical memory.<br>
There are 1241268 free  KB of physical memory.<br>
There are 16171740 total KB of paging file.<br>
There are 2211832 free  KB of paging file.<br>
There are 4194176 total KB of virtual memory.<br>
There are 3286068 free  KB of virtual memory.<br>
There are       0 free  KB of extended memory.<br>
There is       93 percent of memory in use.<br>
There are 8061184 total KB of physical memory.<br>
There are  535040 free  KB of physical memory.<br>
There are 17240328 total KB of paging file.<br>
There are 2555224 free  KB of paging file.<br>
There are 4194176 total KB of virtual memory.<br>
There are 2535072 free  KB of virtual memory.<br>
There are       0 free  KB of extended memory.<br>
terminate called after throwing an instance of 'std::bad_alloc'<br>
  what():  std::bad_alloc<br>
<br>
This application has requested the Runtime to terminate it in an unusual<br>
way.<br>
Please contact the application's support team for more information.<br>
<br>
<br>
<br>
--<br>
Sent from: <a href="http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.<wbr>com/VTK-Users-f1224199.html</a><br>
______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">https://public.kitware.com/<wbr>mailman/listinfo/vtkusers</a><br>
</blockquote></div><br></div>