Hi all,<br><br>I developed a visualization project with VTK and MS Visual Studio.NET 2003. The pipeline is: <br>vtkPoints, vtkDoubleArray-->vtkPolyData-->vtkDelaunay2D-->vtkPolyDataMapper-->vtkRenderer-->vtkRenderWindow-->vtkWindowToImageFilter-->vtkAVIWriter
<br><br>I defined a function vtkWindowToImageFilter *ImgRender() to render each frame. The function is called in a loop to write the image frames to a movie file. The code runs with no error except the virtual memory goes up dramatically. My machine has Windows XP, 1GB RAM. I opened Windows Task Manager while my code was running, the commit charge increased fast, about 3MB per frame. Although the memory usage of my program decreased ( it first went up to 700MB but then decreased to around 60MB), the commit charge just went up until the program stopped with throwing a std::bad_alloc exception. If Windows only allows one process to consume up to
1.6GB memory, my program just stops there. I don't know what is happening here.<br><br>I carefully checked the pairs of New() and Delete(). I am also using vtkSmartPointer. Moreover, I enabled GlobalImmediateModeRenderingOn and ReleaseDataFlagOn. But still, the memory management of my code appears to be a mess. Is it possible memory is not freed even when Delete() is called? Maybe a dumb question, but what is a good way to check memory leak? Could anyone share some experience?
<br><br>Thanks a lot,<br>Janny<br>