# Is it safe to write more data to a file than space you have on ram?

**URL:** <https://discourse.julialang.org/t/is-it-safe-to-write-more-data-to-a-file-than-space-you-have-on-ram/24691>\
**Category:** New to Julia\
**Tags:** memory\
**Created:** [May 28, 2019, 11:51am UTC](https://discourse.julialang.org/t/is-it-safe-to-write-more-data-to-a-file-than-space-you-have-on-ram/24691 "2019-05-28T11:51:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![HBaghdadi1995](https://avatars.discourse-cdn.com/v4/letter/h/13edae/32.png) [@HBaghdadi1995](https://discourse.julialang.org/u/HBaghdadi1995)\
**Post date:** [May 28, 2019, 11:51am UTC](https://discourse.julialang.org/t/is-it-safe-to-write-more-data-to-a-file-than-space-you-have-on-ram/24691/1 "2019-05-28T11:51:08Z")

</div>

Let’s say I have 8GB of ram and decided to open a file and over the course of my software’s run I decide to write 16GB of data to the file. Is this safe or could it cause a crash?

If it is safe, how does it work? Does it automatically flush data to file when almost full? Does it store this data in a temporary file?

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [May 28, 2019, 11:55am UTC](https://discourse.julialang.org/t/is-it-safe-to-write-more-data-to-a-file-than-space-you-have-on-ram/24691/2 "2019-05-28T11:55:10Z")

</div>

I don’t see the connection between the RAM and the file size — when you are writing data, the OS should take care of flushing the cache automatically without user intervention.
