Question: Write a C + + program to print the physical and virtual memory usage in kilobytes ( KB ) of a specified process ID in
Write a C program to print the physical and virtual memory usage in kilobytes KB of a specified process ID in FreeBSD. Requirements: Commandline argument: If a process ID is provided as a commandline argument, the program should display the memory usage for that process. Default behavior: If no process ID is provided, the program should display the memory usage for the current process. Output format: The output should clearly indicate the physical and virtual memory usage in kilobytes. Compilation and Execution: Save the code as memoryusage.cpp Compile: clango memoryusage memoryusage.cpp Run: o For current process: memoryusage o For a specific process: memoryusage
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
