<div dir="ltr">I am using the following python script to extract images from a series of files for an animation:<div><br></div><div><div>try: paraview.simple</div><div>except: from paraview.simple import *</div><div>paraview.simple._DisableFirstRenderCameraReset()</div>
<div><br></div><div>index = [None]*9999</div><div><br></div><div>m = 0</div><div>for i in range(0, 9):</div><div>  for j in range(0, 9):</div><div>    for k in range(0, 9):</div><div>      for l in range(0, 9):</div><div>
        index[m] = chr(i+48)+chr(j+48)+chr(k+48)+chr(l+48)</div><div>        m = m+1</div><div><br></div><div><br></div><div>for i in range(1,2):</div><div><br></div><div>    cf_VP_anim_xmf = XDMFReader( FileName=&#39;XDMF/cf_VP&#39;+index[i]+&#39;.xmf&#39; )</div>
<div><br></div><div>    cf_VP_anim_xmf.CellArrays = []</div><div>    cf_VP_anim_xmf.Sets = []</div><div>    cf_VP_anim_xmf.PointArrays = [&#39;Cf&#39;]</div><div><br></div><div>    RenderView1 = GetRenderView()</div><div>
    a1_Cf_PVLookupTable = GetLookupTableForArray( &quot;Cf&quot;, 1 )</div><div><br></div><div>    Cfcontours = Show()</div><div>    Cfcontours.EdgeColor = [0.0, 0.0, 0.50000762951094835]</div><div>    Cfcontours.SelectionPointFieldDataArrayName = &#39;Cf&#39;</div>
<div>    Cfcontours.ScalarOpacityFunction = []</div><div>    Cfcontours.ColorArrayName = &#39;Cf&#39;</div><div>    Cfcontours.ScalarOpacityUnitDistance = 2.4071425938556859</div><div>    Cfcontours.LookupTable = a1_Cf_PVLookupTable</div>
<div>    Cfcontours.ScaleFactor = 15.0</div><div><br></div><div>    cf_VP_anim_xmf.Grids = [&#39;STL Grid&#39;]</div><div><br></div><div>    RenderView1.CacheKey = 2.0</div><div>    RenderView1.CameraClippingRange = [288.47079837284241, 299.16435388730815]</div>
<div>    RenderView1.UseCache = 0</div><div><br></div><div>    a1_Cf_PVLookupTable.RGBPoints = [-0.0080000000000000002, 0.0, 0.0, 1.0, 0.0080000000000000002, 1.0, 0.0, 0.0]</div><div>    a1_Cf_PVLookupTable.LockScalarRange = 1</div>
<div><br></div><div>    separationline = Contour( PointMergeMethod=&quot;Uniform Binning&quot; )</div><div><br></div><div>    separationline.ContourBy = [&#39;POINTS&#39;, &#39;Cf&#39;]</div><div>    separationline.Isosurfaces = [0.0]</div>
</div><div><div>    DataSeparationLine = Show()</div><div>    DataSeparationLine.ScaleFactor = 12.321390008926393</div><div>    DataSeparationLine.SelectionPointFieldDataArrayName = &#39;Cf&#39;</div><div>    DataSeparationLine.EdgeColor = [0.0, 0.0, 0.50000762951094835]</div>
<div>    DataSeparationLine.LineWidth = 2.0</div><div>    DataSeparationLine.DiffuseColor = [0.0, 0.0, 0.0]</div><div><br></div><div>    DataSeparationLine.ColorArrayName = &#39;&#39;</div><div><br></div><div>    Cfcontours.Visibility = 1</div>
<div><br></div><div>    Q_VP_xmf = XDMFReader( FileName=&#39;XDMF/Q_VP&#39;+index[i]+&#39;.xmf&#39; )</div><div><br></div><div>    Q_VP_xmf.CellArrays = []</div><div>    Q_VP_xmf.Sets = []</div><div>    Q_VP_xmf.PointArrays = [&#39;Q&#39;]</div>
<div><br></div><div>    DataQ = Show()</div><div>    DataQ.Representation = &#39;Outline&#39;</div><div>    DataQ.ScaleFactor = 12.341455459594727</div><div>    DataQ.SelectionPointFieldDataArrayName = &#39;Q&#39;</div><div>
    DataQ.EdgeColor = [0.0, 0.0, 0.50000762951094835]</div><div><br></div><div>    Q_VP_xmf.Grids = [&#39;Eulerian Grid&#39;]</div><div><br></div><div>    ContourQ = Contour( PointMergeMethod=&quot;Uniform Binning&quot; )</div>
<div>    ContourQ.PointMergeMethod = &quot;Uniform Binning&quot;</div><div>    ContourQ.ContourBy = [&#39;POINTS&#39;, &#39;Q&#39;]</div><div>    ContourQ.Isosurfaces = [1.0]</div><div>    ContourQ.ComputeNormals = 0</div>
<div><br></div><div>    DataQiso = Show()</div><div>    DataQiso.ScaleFactor = 7.4976861000061037</div><div>    DataQiso.SelectionPointFieldDataArrayName = &#39;Normals&#39;</div><div>    DataQiso.EdgeColor = [0.0, 0.0, 0.50000762951094835]</div>
<div><br></div><div>    DataQ.Visibility = 0</div><div><br></div><div><br></div><div>    #--- Setup view</div><div>    RenderView1 = GetRenderView()</div><div>    RenderView1.Background = [1.0, 1.0, 1.0]</div><div>    RenderView1.CenterAxesVisibility = 0</div>
<div>    RenderView1.OrientationAxesVisibility = 0</div><div>    RenderView1.ViewSize = [2000, 350]</div><div><br></div><div>    RenderView1.CameraViewUp = [0.0,-1.0, -2.2204460492503131e-16]</div><div>    RenderView1.CameraPosition = [41.5, 0.0, 56.5]</div>
<div>    RenderView1.CameraClippingRange = [120.40716073726786, 126.85668499830999]</div><div>    RenderView1.InteractionMode = &#39;3D&#39;</div><div>    RenderView1.CameraFocalPoint = [0, 0, 56.5]</div><div>    RenderView1.CenterOfRotation = [0, 0, 56.5]</div>
</div><div><br></div><div><div>    #--- Export image</div><div>    Render()</div><div>    WriteImage(&#39;Q_cf_topview_&#39;+index[i]+&#39;.jpg&#39;)</div><div><br></div><div><br></div><div>    #--- Delete objects (order is important)</div>
<div>    Delete(DataSeparationLine)</div><div>    Delete(separationline)</div><div>    Delete(Cfcontours)</div><div>    Delete(cf_VP_anim_xmf)</div><div>    Delete(DataQiso)</div><div>    Delete(ContourQ)</div><div>    Delete(DataQ)</div>
<div>    Delete(Q_VP_xmf)</div></div><div><br></div><div><br></div><div style>At the end of the for loop, I delete all the objects and readers. I run this python script in batch mode (Paraview 3.98) and in parallel with 4 processors. However I am having a memory leak, by the 6th time in the for loop it complains about insufficient memory. Can anyone understand what is causing the memory to increase? Do I forget to delete sth?</div>
<div style><br></div><div style>Thank you,</div><div style><br></div><div style>Nikos</div></div>