# How can I determine the free memory?

**URL:** <https://discourse.julialang.org/t/how-can-i-determine-the-free-memory/81819>\
**Category:** General Usage\
**Tags:** question\
**Created:** [May 27, 2022, 10:34pm UTC](https://discourse.julialang.org/t/how-can-i-determine-the-free-memory/81819 "2022-05-27T22:34:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [May 27, 2022, 10:34pm UTC](https://discourse.julialang.org/t/how-can-i-determine-the-free-memory/81819/1 "2022-05-27T22:34:03Z")

</div>

Is there a way to determine the free and the used memory with Julia?

Perhaps even free heap and free stack?

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [May 28, 2022, 6:35am UTC](https://discourse.julialang.org/t/how-can-i-determine-the-free-memory/81819/2 "2022-05-28T06:35:46Z")

</div>

So it looks as if Julia does not have a function to do this . Sigh. Guess I will try to translate this to Julia: [linux - How to get memory usage at runtime using C++? - Stack Overflow](https://stackoverflow.com/questions/669438/how-to-get-memory-usage-at-runtime-using-c)

---

<div class="post-metadata">

**Author:** ![greg\_plowman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/greg_plowman/32/8100_2.png) [@greg\_plowman](https://discourse.julialang.org/u/greg_plowman)\
**Post date:** [May 28, 2022, 6:50am UTC](https://discourse.julialang.org/t/how-can-i-determine-the-free-memory/81819/3 "2022-05-28T06:50:14Z")

</div>

What about these functions from `Sys`?

```julia
Sys.total_memory() / 2^30
Sys.free_memory() / 2^30

```

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [May 28, 2022, 6:56am UTC](https://discourse.julialang.org/t/how-can-i-determine-the-free-memory/81819/4 "2022-05-28T06:56:39Z")

</div>

Thank you, this was what I was looking for. 🙂

Ok. a function that determines the memory used by the current process would also be nice to have…
