[Paraview] paraview python script : Delete(renderView1) does not free memory
Raj Kumar Manna
rajphysics.mon at gmail.com
Thu Jul 16 00:34:12 EDT 2015
Thanks Utkarsh. This script solved my problem.
On Wed, Jul 15, 2015 at 7:44 PM, Utkarsh Ayachit <
utkarsh.ayachit at kitware.com> wrote:
> Delete() will only remove the render view, not all other proxies that were
> created as part of the state loading operation. The following script should
> do the trick:
>
>
> --------------------------------------------------------------------------------
> from paraview.simple import *
>
> def ResetSession():
> pxm = servermanager.ProxyManager()
> pxm.UnRegisterProxies()
> del pxm
> Disconnect()
> Connect()
>
> for i in range(0, 10):
> ResetSession()
> servermanager.LoadState("/tmp/sample.pvsm")
> renderView=SetActiveView(GetRenderView())
> Render()
>
> --------------------------------------------------------------------------------
>
> Utkarsh
>
>
> On Wed, Jul 15, 2015 at 12:52 AM Raj Kumar Manna <rajphysics.mon at gmail.com>
> wrote:
>
>> Dear All,
>>
>> I am trying to load multiple state files by running a python script with
>> python shell. The script is the following
>>
>> #### import the simple module from the paraview
>> from paraview.simple import *
>>
>> for time in range(0,200):
>> renderView1 = GetActiveViewOrCreate('RenderView')
>>
>> # destroy renderView1
>> Delete(renderView1)
>> del renderView1
>>
>> filename = 'filepath/filename-%s.pvsm' % time
>> servermanager.LoadState(filename)
>> renderView=SetActiveView(GetRenderView())
>> Render()
>> # get layout
>> viewLayout = GetLayout()
>>
>> # save screenshot
>> SaveScreenshot('filepath/filename-%s.png' % time,
>> layout=viewLayout, magnification=3, quality=100)
>>
>> I was monitoring the memory used by machine, after some time steps the
>> memory used by the machine is whole RAM. Can anybody tell me what I am
>> doing wrong here.
>>
>> I appreciate your time and support.
>>
>>
>> Thanks
>> Raj
>>
>>
>>
>> --
>> ##################################################################
>> Raj Kumar Manna
>> Complex Fluid & Biological Physics Lab
>> IIT Madras
>>
>> Ph. No. 8144637401
>>
>> alternate email: raj at physics.iitm.ac.in <rajphysics.mon at gmail.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 ParaView Wiki at:
>> http://paraview.org/Wiki/ParaView
>>
>> Search the list archives at: http://markmail.org/search/?q=ParaView
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/paraview
>>
>
--
##################################################################
Raj Kumar Manna
Complex Fluid & Biological Physics Lab
IIT Madras
Ph. No. 8144637401
alternate email: raj at physics.iitm.ac.in <rajphysics.mon at gmail.com>
####################################################################
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20150716/97707299/attachment.html>
More information about the ParaView
mailing list