INFO
This English version is translated by Gemini 3 Flash.
Linux Low Memory Optimization
Enable SWAP
Check current SWAP status
bashsudo swapon --showCreate SWAP file
bashfallocate -l 4G /swapfileSet permissions
bashchmod 600 /swapfileFormat and enable SWAP
bashmkswap /swapfile swapon /swapfileSet auto-mount on boot
bashecho '/swapfile none swap sw 0 0' | tee -a /etc/fstab
Enable ZRAM
Debian / Ubuntu
Install
bashapt update apt install zram-tools -yModify configuration file
bashnano /etc/default/zramswapAdd or modify the following:
bash# Use lz4 compression algorithm for the best balance of speed and ratio ALGO=lz4 # Use 60% of total memory as ZRAM size PERCENT=60 # [Crucial] Set priority to 100. # As long as this is higher than disk Swap (usually -2), the system will prioritize ZRAM. PRIORITY=100Press
Ctrl+OEnter to save,Ctrl+Xto exit.Restart service
bashsystemctl daemon-reload systemctl restart zramswap
CentOS / Arch Linux
Recommended to use zram-generator for these systems.
Install
bash# CentOS 8/9, Fedora, AlmaLinux, Rocky Linux dnf install zram-generator -y # Arch Linux pacman -S zram-generatorModify configuration file Create or edit
/etc/systemd/zram-generator.conf:ini[zram0] # Use 60% of total memory zram-size = ram * 0.6 # Use lz4 compression algorithm compression-algorithm = lz4 # Higher priority than disk Swap swap-priority = 100Start service
bashsystemctl daemon-reload systemctl start systemd-zram-setup@zram0
General Optimization
Regardless of the system, it is recommended to adjust swappiness to use ZRAM more aggressively.
grep -q "vm.swappiness" /etc/sysctl.conf || echo "vm.swappiness=20" | tee -a /etc/sysctl.conf
sysctl -pDisable Site Isolation (fission.autostart)
For servers with extremely tight memory (e.g., 1GB RAM), if the system still crashes frequently after enabling SWAP and ZRAM, you can try disabling Firefox's Site Isolation as a last resort.
Risk Disclosure
Disabling Site Isolation reduces the uniqueness of the browser fingerprint, potentially making it easier for high-level anti-bot systems to identify (e.g., by detecting single-process model or inter-process communication delays). Use only when necessary.
Modify
config.yaml:yamlbrowser: # ... # Disable site isolation to significantly reduce memory footprint fission: falseRestart WebAI2API service.
Tip
After completing the configuration, it is recommended to restart the server to ensure all settings take effect.