vtk知识之ReleaseDataFlagOn();

来源:互联网 发布:nginx upstream proxy 编辑:程序博客网 时间:2024/06/04 08:40

reader->ReleaseDataFlagOn();

Using ReleaseDataFlag

By default VTK keeps a copy of all intermediate results between filters in a pipeline. For a pipeline with five filters this can result in having six copies of the data in memory at once. This can be controlled using ReleaseDataFlag and GlobalReleaseDataFlag. If ReleaseDataFlag is set to one on a data object, then once a filter has finished using that data object, it will release its memory. Likewise, if GlobalReleaseDataFlag is set on ANY data object, all data objects will release their memory once their dependent filter has finished executing. For example in Tcl and C++

通过ReleaseDataFlag对滤波器过程中的数据备份控制,一个滤波器完成对这个目标的数据利用后马上就被释放。减少对内存影响,但也有缺点,就是对内存中不会保留所有的中间结果。

参考:http://www.docin.com/p-879189412.html