Se você tem acesso root, sim.
sudo mkdir /media/RAM # Let's make a mount point
sudo mount /dev/ram /media/RAM # Let's tell the OS to use RAM as storage
cd /media/RAM # Let's go to the RAM directory
i=0 # Let's get an iteration counter
while true # Let's do something forever (or at least as long as we can)
do # Do something
let i=$i+1 # Something is incrementing our iteration counter
dd if=/dev/zero of=$i bs=10M # So here's the real work
sleep 2 # Ok, OP doesn't like it when his ramhog
# script runs out of ram (?) So let's slow it down.
done # Wait a minute, I though we were doing this forever? How can we be done?
Então, como isso funciona é muito bem explicitado nos comentários acima. Basta copiar e colar isso no vi ou no nano, salvá-lo e executar sudo chmod 755 [filename]
e, em seguida, executar ./[filename]
. Divirta-se ficando sem memória RAM.