# ParaView saves only small portion of data when saving data in a time step loop

**URL:** https://discourse.paraview.org/t/paraview-saves-only-small-portion-of-data-when-saving-data-in-a-time-step-loop/9003
**Category:** ParaView Support
**Tags:** python
**Created:** [February 17, 2022, 5:55pm UTC](https://discourse.paraview.org/t/paraview-saves-only-small-portion-of-data-when-saving-data-in-a-time-step-loop/9003 "2022-02-17T17:55:28Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ckpark96](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ckpark96/32/8553_2.png) [@ckpark96](https://discourse.paraview.org/u/ckpark96)
#### Post date: [February 17, 2022, 5:55pm UTC](https://discourse.paraview.org/t/paraview-saves-only-small-portion-of-data-when-saving-data-in-a-time-step-loop/9003/1 "2022-02-17T17:55:28Z")

</div>

Dear all,

I am using a Python script to save the data as .xmf file for every time step using a for-loop shown in line 476 to 489.  
[pv-reduce.py](https://discourse.paraview.org/uploads/short-url/1XrrUyEszx7WtMTM0ippZhDxrQe.py) (63.4 KB)  
The Python script was used instead of the option “Write all time steps” under save data because using this option caused ParaView to crash after a few time steps.

So now, using the Python script for-loop, the issue is that it is not saving the full data but only a small portion of data of each time step. I tried implementing **time.sleep(x)** to make Python wait for Paraview for **x** number of seconds but it still did not work.

How can I save data of all time steps without causing ParaView to crash? My machine is equipped with 8 core CPU and 32gb of RAM with rtx3060 max-q. Could this be a bottleneck for such an operation?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 23, 2022, 12:43pm UTC](https://discourse.paraview.org/t/paraview-saves-only-small-portion-of-data-when-saving-data-in-a-time-step-loop/9003/2 "2022-02-23T12:43:09Z")

</div>

> [@ckpark96](#):
>
> The Python script was used instead of the option “Write all time steps” under save data because using this option caused ParaView to crash after a few time steps.

Looks like you are running out of memory.

> So now, using the Python script for-loop, the issue is that it is not saving the full data but only a small portion of data of each time step.

please share an image of the issue

---

<div class="post-metadata">

### Author: ![ckpark96](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ckpark96/32/8553_2.png) [@ckpark96](https://discourse.paraview.org/u/ckpark96)
#### Post date: [February 23, 2022, 2:23pm UTC](https://discourse.paraview.org/t/paraview-saves-only-small-portion-of-data-when-saving-data-in-a-time-step-loop/9003/3 "2022-02-23T14:23:14Z")

</div>

By memory do you mean RAM memory or storage memory?

![paraview_savedata](https://discourse.paraview.org/uploads/default/original/2X/c/c584bee3076f13730d9e8f41ebab116bee44072f.png)

So here, you can see that the actual file size of a single time step is supposed to be around 170 MB. However, when I run the Python script that I attached in the original post, it gives a consistent file size of 74.5 MB which is way smaller than it should be.

So to me, it seems like Python has a fixed duration that stays on the ‘save data’ line of code and it is not waiting for Paraview to fully save data before moving onto the next.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 23, 2022, 2:24pm UTC](https://discourse.paraview.org/t/paraview-saves-only-small-portion-of-data-when-saving-data-in-a-time-step-loop/9003/4 "2022-02-23T14:24:20Z")

</div>

> [@ckpark96](#):
>
> RAM memory

I mean RAM
