Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database Foundations Technology Fundamentals For IT Success

Authors: Bob Bryla

1st Edition

0782143725, 9780782143720

More Books

Students also viewed these Databases questions