Verify settings in /proc/sys/vm
In this step, you will explore the /proc
filesystem, specifically the /proc/sys/vm
directory, to see how kernel parameters related to virtual memory are exposed.
The /proc
filesystem is a virtual filesystem that provides information about processes and other system information. It's a great place to inspect the kernel's current state. The /proc/sys
directory within /proc
contains files that correspond to kernel parameters that can be viewed and sometimes modified at runtime.
The /proc/sys/vm
directory holds files related to the virtual memory subsystem. The vm.overcommit_memory
parameter we checked in the previous step has a corresponding file in this directory.
Let's use the cat
command to view the content of the file that represents vm.overcommit_memory
. The cat
command is used to display the content of files.
Type the following command into your terminal and press Enter:
cat /proc/sys/vm/overcommit_memory
This command will read the content of the overcommit_memory
file located in /proc/sys/vm
and print it to your terminal.
You should see the same value that you saw with the sysctl
command in the previous step:
0
This demonstrates that sysctl
is essentially reading from or writing to these files in the /proc/sys
filesystem.
You can also list the files in the /proc/sys/vm
directory to see other virtual memory related parameters. Use the ls
command:
ls /proc/sys/vm/
You will see a list of files, each representing a different kernel parameter related to virtual memory.
compact_hueristic
compact_memory
dirty_background_bytes
dirty_background_ratio
dirty_bytes
dirty_expire_centisecs
dirty_ratio
dirty_writeback_centisecs
drop_caches
extfrag_threshold
hugetlb_shm_group
laptop_mode
lowmem_reserve_ratio
min_free_bytes
min_slab_ratio
min_unmapped_ratio
mmap_min_addr
nr_hugepages
nr_hugepages_mempolicy
nr_overcommit_hugepages
numa_balancing
numa_balancing_scan_period_max_ms
numa_balancing_scan_period_min_ms
numa_balancing_scan_size_mb
numa_balancing_settle_count
numa_balancing_timeout
oom_dump_tasks
oom_kill_allocating_task
overcommit_memory
overcommit_ratio
page-cluster
panic_on_oom
percpu_pagelist_fraction
stat_interval
swappiness
user_reserve_kbytes
vfs_cache_pressure
watermark_boost_factor
watermark_scale_factor
zone_reclaim_mode
This gives you a glimpse into the many tunable parameters available in the Linux kernel's virtual memory subsystem.
Click Continue to move on.