Thread: [wxVTK] memory leak when using wxWidgets and VTK
Brought to you by:
malat
From: Bangyou Z. <zhe...@gm...> - 2009-04-13 14:07:54
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=GB2312"> </head> <body bgcolor="#ffffff" text="#000000"> <font face="Arial">I have the similar problem about memory leak described by Premraj, Senthil Kumar. The URL is :<br> <br> <a class="moz-txt-link-freetext" href="http://sourceforge.net/mailarchive/forum.php?thread_name=CE95C4CC27808146AB22964FE8C94D66016D91462CAB%40IOWAEVS05.iowa.uiowa.edu&forum_name=wxvtk-users">http://sourceforge.net/mailarchive/forum.php?thread_name=CE95C4CC27808146AB22964FE8C94D66016D91462CAB%40IOWAEVS05.iowa.uiowa.edu&forum_name=wxvtk-users</a><br> <br> </font> <p><font face="Arial"><b>1) Problem description:</b></font></p> <font face="Arial">I need to redraw the vtkRenderer when users click the someplace of window. Firstly, the all props were deleted:<b><br> m_Renderer->RemoveAllViewProps();</b><br> <br> Then, these codes were used to redraw the vtkRenderer<br> <br> <b>vtkPoints * pts = vtkPoints::New();<br> vtkUnstructuredGrid * aTriangleGrid = vtkUnstructuredGrid::New();<br> vtkDataSetMapper * aTriangleMapper = vtkDataSetMapper::New();<br> vtkActor * Actor = vtkActor::New();</b><br> <br> // some codes to create the Props<br> <br> <b>m_Renderer->AddViewProp( Actor );<br> <br> pts->Delete();<br> aTriangleGrid->Delete();<br> aTriangleMapper->Delete();<br> Actor->Delete();</b><br> <br> Finally, The memory usage was growing with redrawing the vtkRenderer <br> <br> </font> <p><b><font face="Arial">2) My environment</font></b></p> <font face="Arial">Windows XP SP2</font><br> <font face="Arial">mingw32-gcc-3.4.5<br> </font><font face="Arial">wxWidgets 2.8.9 linked as dll<br> VTK 5.0 linked as dll<br> wxVTKRenderWindowInteractor cvs version (up to now)<br> <br> <br> I know this problem can be avoided by using linker's /delayload flag of MFC, but how to fix this problem for mingw? <br> <br> Thanks a lot!<br> <br> <br> <br> <br> </font> </body> </html> |
From: Bangyou Z. <zhe...@gm...> - 2009-04-14 09:12:20
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=GB2312"> </head> <body bgcolor="#ffffff" text="#000000"> <font face="Arial">I have the similar problem about memory leak described by Premraj, Senthil Kumar. The URL is :<br> <br> <a class="moz-txt-link-freetext" href="http://sourceforge.net/mailarchive/forum.php?thread_name=CE95C4CC27808146AB22964FE8C94D66016D91462CAB%40IOWAEVS05.iowa.uiowa.edu&forum_name=wxvtk-users">http://sourceforge.net/mailarchive/forum.php?thread_name=CE95C4CC27808146AB22964FE8C94D66016D91462CAB%40IOWAEVS05.iowa.uiowa.edu&forum_name=wxvtk-users</a><br> <br> 1) Problem description:<br> I need to redraw the vtkRenderer when users click the someplace of window. Firstly, the all props were deleted:<br> m_Renderer->RemoveAllViewProps();<br> <br> Then, these codes were used to redraw the vtkRenderer<br> <br> vtkPoints * pts = vtkPoints::New();<br> vtkUnstructuredGrid * aTriangleGrid = vtkUnstructuredGrid::New();<br> vtkDataSetMapper * aTriangleMapper = vtkDataSetMapper::New();<br> vtkActor * Actor = vtkActor::New();<br> <br> // some codes to create the Props<br> <br> m_Renderer->AddViewProp( Actor );<br> <br> pts->Delete();<br> aTriangleGrid->Delete();<br> aTriangleMapper->Delete();<br> Actor->Delete();<br> <br> Finally, The memory usage was growing with redrawing the vtkRenderer<br> <br> 2) My environment<br> Windows XP SP2<br> mingw32-gcc-3.4.5<br> wxWidgets 2.8.9 linked as dll<br> VTK 5.0 linked as dll<br> wxVTKRenderWindowInteractor cvs version (up to now)<br> <br> <br> I know this problem can be avoided by using linker's /delayload flag of MFC, but how to fix this problem for mingw?<br> <br> Thanks a lot!<br> <br> <br> <br> <br> </font> </body> </html> |
From: Mathieu M. <mat...@gm...> - 2009-04-14 12:32:54
|
[you do not need to duplicate email, you will not get duplicate answer] 2009/4/14 Bangyou Zheng <zhe...@gm...>: > I have the similar problem about memory leak described by Premraj, Senthil > Kumar. The URL is : > > http://sourceforge.net/mailarchive/forum.php?thread_name=CE95C4CC27808146AB22964FE8C94D66016D91462CAB%40IOWAEVS05.iowa.uiowa.edu&forum_name=wxvtk-users > > 1) Problem description: > I need to redraw the vtkRenderer when users click the someplace of window. > Firstly, the all props were deleted: > m_Renderer->RemoveAllViewProps(); > > Then, these codes were used to redraw the vtkRenderer > > vtkPoints * pts = vtkPoints::New(); > vtkUnstructuredGrid * aTriangleGrid = vtkUnstructuredGrid::New(); > vtkDataSetMapper * aTriangleMapper = vtkDataSetMapper::New(); > vtkActor * Actor = vtkActor::New(); > > // some codes to create the Props > > m_Renderer->AddViewProp( Actor ); > > pts->Delete(); > aTriangleGrid->Delete(); > aTriangleMapper->Delete(); > Actor->Delete(); > > Finally, The memory usage was growing with redrawing the vtkRenderer > > 2) My environment > Windows XP SP2 > mingw32-gcc-3.4.5 > wxWidgets 2.8.9 linked as dll > VTK 5.0 linked as dll > wxVTKRenderWindowInteractor cvs version (up to now) > > > I know this problem can be avoided by using linker's /delayload flag of MFC, > but how to fix this problem for mingw? > > Thanks a lot! I would think setting some renderer instance to NULL might help. (->SetRenderer(NULL)). HTH -- Mathieu |
From: Bangyou Z. <zhe...@gm...> - 2009-04-14 23:50:51
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> Sorry for the duplicate message.<br> This problem has solved by updating VTK to cvs version.<br> <br> Mathieu Malaterre wrote: <blockquote cite="mid:bf0...@ma..." type="cite"> <pre wrap="">[you do not need to duplicate email, you will not get duplicate answer] 2009/4/14 Bangyou Zheng <a class="moz-txt-link-rfc2396E" href="mailto:zhe...@gm..."><zhe...@gm...></a>: </pre> <blockquote type="cite"> <pre wrap="">I have the similar problem about memory leak described by Premraj, Senthil Kumar. The URL is : <a class="moz-txt-link-freetext" href="http://sourceforge.net/mailarchive/forum.php?thread_name=CE95C4CC27808146AB22964FE8C94D66016D91462CAB%40IOWAEVS05.iowa.uiowa.edu&forum_name=wxvtk-users">http://sourceforge.net/mailarchive/forum.php?thread_name=CE95C4CC27808146AB22964FE8C94D66016D91462CAB%40IOWAEVS05.iowa.uiowa.edu&forum_name=wxvtk-users</a> 1) Problem description: I need to redraw the vtkRenderer when users click the someplace of window. Firstly, the all props were deleted: m_Renderer->RemoveAllViewProps(); Then, these codes were used to redraw the vtkRenderer vtkPoints * pts = vtkPoints::New(); vtkUnstructuredGrid * aTriangleGrid = vtkUnstructuredGrid::New(); vtkDataSetMapper * aTriangleMapper = vtkDataSetMapper::New(); vtkActor * Actor = vtkActor::New(); // some codes to create the Props m_Renderer->AddViewProp( Actor ); pts->Delete(); aTriangleGrid->Delete(); aTriangleMapper->Delete(); Actor->Delete(); Finally, The memory usage was growing with redrawing the vtkRenderer 2) My environment Windows XP SP2 mingw32-gcc-3.4.5 wxWidgets 2.8.9 linked as dll VTK 5.0 linked as dll wxVTKRenderWindowInteractor cvs version (up to now) I know this problem can be avoided by using linker's /delayload flag of MFC, but how to fix this problem for mingw? Thanks a lot! </pre> </blockquote> <pre wrap=""><!----> I would think setting some renderer instance to NULL might help. (->SetRenderer(NULL)). HTH </pre> </blockquote> <br> </body> </html> |
From: Mathieu M. <mat...@gm...> - 2009-04-15 07:53:51
|
On Wed, Apr 15, 2009 at 1:50 AM, Bangyou Zheng <zhe...@gm...> wrote: > Sorry for the duplicate message. > This problem has solved by updating VTK to cvs version. Cool ! -- Mathieu |