#! /bin/bash
#
# clear_ram.sh - Clear as much user-space ram as possible
# (until the OOM_killer gets us)
#
swapoff -a
mem=$(free -b | grep Mem | awk '{print $2}')
mount none -t tmpfs -o size=$mem /tmp
dd if=/dev/zero of=/tmp/zero.dat bs=1M &
echo "17" > /proc/$(pidof dd)/oomadj
while (pidof dd); do kill -USR1 $(pidof dd); done
这是一个外壳脚本。这段代码有什么作用?
不是家庭作业