[vtkusers] vtkImageData - vtkUnsignedCharArray: Unable to allocate 768951260 elements of size 1 bytes.

Allie Vacanti allison.vacanti at kitware.com
Tue Jul 17 11:42:29 EDT 2018


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.

What's the value of the dims arg? That's what is ultimately determining the
size of this array.

>From the linked code, the final size of the output scalar array will be

(dims[0] + 2) * (dims[1] + 2) * (dims[2] + 2)

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.

On Tue, Jul 17, 2018 at 10:49 AM, vacingforo <vacingforo at gmail.com> wrote:

> Hello,
>
> This is the evolution of the memory which is included in the main.cpp
> posted
> link:
> The memory change from:
>
> There is       62 percent of memory in use to There is       93 percent of
> memory in use.
>
> Output program:
>
> Start...
> There is       62 percent of memory in use.
> There are 8061184 total KB of physical memory.
> There are 3050704 free  KB of physical memory.
> There are 16171740 total KB of paging file.
> There are 3346076 free  KB of paging file.
> There are 4194176 total KB of virtual memory.
> There are 4044480 free  KB of virtual memory.
> There are       0 free  KB of extended memory.
> There is       62 percent of memory in use.
> There are 8061184 total KB of physical memory.
> There are 3050404 free  KB of physical memory.
> There are 16171740 total KB of paging file.
> There are 3346076 free  KB of paging file.
> There are 4194176 total KB of virtual memory.
> There are 4044480 free  KB of virtual memory.
> There are       0 free  KB of extended memory.
> There is       62 percent of memory in use.
> There are 8061184 total KB of physical memory.
> There are 3050276 free  KB of physical memory.
> There are 16171740 total KB of paging file.
> There are 2598940 free  KB of paging file.
> There are 4194176 total KB of virtual memory.
> There are 3293492 free  KB of virtual memory.
> There are       0 free  KB of extended memory.
> There is       70 percent of memory in use.
> There are 8061184 total KB of physical memory.
> There are 2370144 free  KB of physical memory.
> There are 16171740 total KB of paging file.
> There are 2620368 free  KB of paging file.
> There are 4194176 total KB of virtual memory.
> There are 3293492 free  KB of virtual memory.
> There are       0 free  KB of extended memory.
> There is       84 percent of memory in use.
> There are 8061184 total KB of physical memory.
> There are 1241268 free  KB of physical memory.
> There are 16171740 total KB of paging file.
> There are 2211832 free  KB of paging file.
> There are 4194176 total KB of virtual memory.
> There are 3286068 free  KB of virtual memory.
> There are       0 free  KB of extended memory.
> There is       93 percent of memory in use.
> There are 8061184 total KB of physical memory.
> There are  535040 free  KB of physical memory.
> There are 17240328 total KB of paging file.
> There are 2555224 free  KB of paging file.
> There are 4194176 total KB of virtual memory.
> There are 2535072 free  KB of virtual memory.
> There are       0 free  KB of extended memory.
> terminate called after throwing an instance of 'std::bad_alloc'
>   what():  std::bad_alloc
>
> This application has requested the Runtime to terminate it in an unusual
> way.
> Please contact the application's support team for more information.
>
>
>
> --
> Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> https://public.kitware.com/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20180717/b43fa6ca/attachment.html>


More information about the vtkusers mailing list