-
Notifications
You must be signed in to change notification settings - Fork 0
Memory
Andrei Montchik edited this page Jul 1, 2024
·
9 revisions
- Review:
sudo swapon --show - Resize:
- disable:
sudo swapoff /swap.img - resize:
sudo fallocate -l 32G /swap.img - mark the file as swap:
sudo mkswap /swap.img - enable swap file:
sudo swapon /swap.img
- disable:
- Disable:
- Identify the swap file
sudo swapon --show. - Disable swapping until the next reboot:
sudo swapoff <SWAP_FILE>. - Comment out the swap configuration line in
/etc/fstabto permanently disable swapping.
- Identify the swap file
- Check the current limit:
sysctl vm.max_map_count - Increase:
- Search for the
vm.max_map_countparameter the sysctl configuration files:sudo grep max_map_count /etc/sysctl.confsudo grep max_map_count /etc/sysctl.d/*
- Update the existing or insert the new map count parameter to
/etc/sysctl.conf:vm.max_map_count = 1000000 - Reload the sysctl service:
sudo sysctl -p - Confirm that the files limit was updated:
sysctl vm.max_map_count
- Use stress-ng
- Free memory:
free -thorcat /proc/meminfo | grep MemFree- refresh every second:
free -th -s 1
- refresh every second:
- Top 10 processes that use most memory:
ps aux --sort=-%mem | head -10