# Get machine memory in elixir/erlang

**URL:** <https://forum.elixirforum.com/t/get-machine-memory-in-elixir-erlang/22204>\
**Category:** Questions\
**Tags:** ets, memory\
**Created:** [May 6, 2019, 2:30pm UTC](https://forum.elixirforum.com/t/get-machine-memory-in-elixir-erlang/22204 "2019-05-06T14:30:42Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![josevalim](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/32/1787_2.png) [@josevalim](https://forum.elixirforum.com/u/josevalim)\
**Post date:** [May 6, 2019, 2:39pm UTC](https://forum.elixirforum.com/t/get-machine-memory-in-elixir-erlang/22204/2 "2019-05-06T14:39:33Z")

</div>

You shouldn’t start it directly. You should start the `:os_mon` application which will start it for you. Generally speaking, always make sure to start an application before invoking any of its modules:

```
iex(2)> Application.ensure_all_started(:os_mon)
{:ok, [:sasl, :os_mon]}
iex(3)> :memsup.get_system_memory_data
[
  total_memory: 12652220416,
  free_memory: 23302144,
  system_total_memory: 12652220416
]

```

---

_[View the full topic](https://forum.elixirforum.com/t/get-machine-memory-in-elixir-erlang/22204)._
