# Limit / Measure Juliaprogram Memory / RAM consumption

**URL:** <https://discourse.julialang.org/t/limit-measure-juliaprogram-memory-ram-consumption/99523>\
**Category:** New to Julia\
**Created:** [May 28, 2023, 6:14pm UTC](https://discourse.julialang.org/t/limit-measure-juliaprogram-memory-ram-consumption/99523 "2023-05-28T18:14:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ralf\_Dietrich](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ralf_dietrich/32/5643_2.png) [@Ralf\_Dietrich](https://discourse.julialang.org/u/Ralf_Dietrich)\
**Post date:** [May 28, 2023, 6:14pm UTC](https://discourse.julialang.org/t/limit-measure-juliaprogram-memory-ram-consumption/99523/1 "2023-05-28T18:14:03Z")

</div>

I want to write a program where I can specify the maximum amount of RAM it can use after startup. I therefore need a function that shows me the current value of RAM that the running program is currently using.

Can someone help me with this?

The functions under `https://docs.julialang.org/en/v1/base/base/#System`  
do not seem to be suitable for this.

---

<div class="post-metadata">

**Author:** ![bjarthur](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bjarthur/32/9638_2.png) [@bjarthur](https://discourse.julialang.org/u/bjarthur)\
**Post date:** [May 28, 2023, 10:08pm UTC](https://discourse.julialang.org/t/limit-measure-juliaprogram-memory-ram-consumption/99523/2 "2023-05-28T22:08:55Z")

</div>

`julia --heap-size-hint` ?

---

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [May 30, 2023, 5:49am UTC](https://discourse.julialang.org/t/limit-measure-juliaprogram-memory-ram-consumption/99523/3 "2023-05-30T05:49:07Z")

</div>

This thread might help. I was going to suggest looking at /proc//statm but that is Linux specific

> [@How to track total memory usage of Julia process over time](https://discourse.julialang.org/t/how-to-track-total-memory-usage-of-julia-process-over-time/91167/9):
>
> Hm, it works for me with Julia v1.8.3 on Linux and macOS. Which OS and Julia version are you using?

---

<div class="post-metadata">

**Author:** ![Ralf\_Dietrich](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ralf_dietrich/32/5643_2.png) [@Ralf\_Dietrich](https://discourse.julialang.org/u/Ralf_Dietrich)\
**Post date:** [July 9, 2023, 6:21pm UTC](https://discourse.julialang.org/t/limit-measure-juliaprogram-memory-ram-consumption/99523/4 "2023-07-09T18:21:46Z")

</div>

Thanks for pointing that out, because it’s a start. Julia should get something built in to solve this elegantly for all operating systems uniformly
