DEV Community

Carlos Saltos
Carlos Saltos

Posted on

How do you get total amount of RAM memory Linux has using Scala

What ?

A simple Scala program to get the total RAM on a Linux machine

Why ?

Because I want to check from SBT if there is enough total RAM memory to run certain compilation options and I would like to share with others

How ?

Just go to https://github.com/csaltos/mem-on-linux-scala/blob/main/MemOnLinux.scala and copy paste the code, you can use it as bytes or gigabytes or filter for other memory options like memory free or available memory.

Top comments (0)