[vtkusers] vtkUniformVariables memory leak

Cory Quammen cory.quammen at kitware.com
Mon Aug 18 09:57:57 EDT 2014


The short answer is that there shouldn't be any memory leaks, but it
is always possible that there is a bug in VTK.

Can you post a small example (.cxx file, CMakeLists.txt file) that
exhibits this behavior? It will make it easier to help you debug.

Thanks,
Cory

On Sat, Aug 16, 2014 at 1:31 AM, eternallite2 <cdavid.tran at gmail.com> wrote:
> I set up a shader for my vtkActor by calling the setPropProgram method of my
> actor's property
> (assigning it a vtkShaderProgram2):
>
> vtkOpenGLProperty::SafeDownCast(actor->GetProperty())->SetPropProgram(program);
>
> Then in a loop I am constantly updating a uniform variable (called time
> which increments as time goes by) in that shader by calling setUniformit:
>
> int time = 0;
> time += 1;
> if (time > 500)
>     time = 0;
>
> vtkOpenGLProperty::SafeDownCast(actor->GetProperty())->GetPropProgram()->GetUniformVariables()->SetUniformft("time",
> 1, &time);
>
> I see the process in the Task Manager and since the time variable is
> constantly being incremented, the amount of memory used by the program keeps
> growing until it uses all the RAM.
>
> Is there a particular place where I should put the setUniform calls to avoid
> this memory leak;
> or is this a bug inside of vtk itself.
>
> Thanks again
>
>
>
>
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/vtkUniformVariables-memory-leak-tp5728234.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers


More information about the vtkusers mailing list