Question
Task 1 - Memory Information For this task you will need to create a C++ program to read mem- ory information about the system, you
Task 1 - Memory Information
For this task you will need to create a C++ program to read mem-
ory information about the system, you should use the lename called "meminfo.cpp"
and the target executable "meminfo". There are several ways one can detect system
memory information in a Linux environment. One method is to do it programmatically
by reading a special le within the system, the other method is to make use of a certain
executable ("free") that you will call in your C++ code and perform the necessary data
manipulation. You should chose only one of the mentioned approaches in your solution.
Things to note:
1. You must make use of a subprocess call (eg. popen) if you choose the executable
route.
2. Your program must display the sizes of each segment in "Human Readable" bytes.
Your program should show the closest range to dierent sizes for example, 1020
bytes, or 13.65 KB, etc.
3. Make use of xed 2 decimal points for each value.
Your output should look something like this.
Note: Memory information about system might dier from other distribu-
tions and hardware capabilities.
Upload your meminfo.cpp file
Your output should look something like this. /meminfo EMINFO Total Main Memory: 15.89 GB Total Virtual Memory: 48.80 GB Total Overall Memory: 63.89 GB Total Overall Free Memory: 54.53 GB Percentage of Overall Memory Utilized : 14.65%Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started