linux memory usage

C++
free -m// linux command for reporting used memory percentage
$ free | grep Mem | awk '{print $3/$2 * 100.0}'
23.8171
$ cat /proc/meminfo$ free -t | awk 'NR == 2 {printf("Current Memory Utilization is : %.2f%"), $3/$2*100}'
or
$ free -t | awk 'FNR == 2 {printf("Current Memory Utilization is : %.2f%"), $3/$2*100}'

Current Memory Utilization is : 20.42%
sudo dmidecode -t 17for more information search this webside --
https://www.howtogeek.com/659529/how-to-check-memory-usage-from-the-linux-terminal/
Source

Also in C++: