CompTIA Linux+ XK0-006 (V8) Practice Question

A custom C++ service on a test system gradually consumes all available RAM. Running top shows the process's RES value steadily increasing, and the kernel eventually invokes the OOM killer. You clone the service to a development VM and need a single command that will confirm a heap memory leak and display stack traces for every leaked allocation when the program exits. Which command best meets this requirement?

  • vmstat -m 2

  • valgrind --leak-check=full ./myservice --test-mode

  • sar -r 5 120

  • pmap -x $(pidof myservice) | tail -n 1

CompTIA Linux+ XK0-006 (V8)
Troubleshooting
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

Bash, the Crucial Exams Chat Bot
AI Bot