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.

Task 1 - Memory Information For this task you will need to

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!