nerdexam
CompTIA

XK0-005 · Question #77

A server is almost out of free memory and is becoming unresponsive. Which of the following sets of commands will BEST mitigate the issue?

The correct answer is D. fdisk, mkswap, swapon -a. When a Linux system runs critically low on RAM, adding swap space provides immediate relief by giving the kernel additional virtual memory. The process is: 'fdisk' to create a new disk partition (or identify an existing one), 'mkswap' to format that partition as swap space, and…

Troubleshooting

Question

A server is almost out of free memory and is becoming unresponsive. Which of the following sets of commands will BEST mitigate the issue?

Options

  • Afree, fack, partprobe
  • Blsof, lvcreate, mdadm
  • Cdf, du, rmmod
  • Dfdisk, mkswap, swapon -a

How the community answered

(35 responses)
  • A
    9% (3)
  • B
    3% (1)
  • C
    17% (6)
  • D
    71% (25)

Explanation

When a Linux system runs critically low on RAM, adding swap space provides immediate relief by giving the kernel additional virtual memory. The process is: 'fdisk' to create a new disk partition (or identify an existing one), 'mkswap' to format that partition as swap space, and 'swapon -a' to activate all swap partitions listed in /etc/fstab (or the newly created one specifically). This allows the kernel to page out less-used memory to disk, freeing RAM for active processes. The other option sets (free/fack/partprobe, lsof/lvcreate/mdadm, df/du/rmmod) do not directly address adding or enabling swap memory.

Topics

#Memory Management#Swap Space#Disk Partitioning#Troubleshooting

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice