This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# start with nohup ./swapcheck.sh & echo $! >> pid.txt | |
echo "Tracking swap..." >> out.txt | |
while [[ $(top -l 1 -o mem -n 0 | grep -o -E '.{0,6}swapins' | cut -c 1) == " " ]] | |
do | |
sleep 1 | |
done | |
date >> out.txt | |
echo " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <math.h> | |
/* This short program fills RAM in 1GB chunks with random data to make a computer swap */ | |
int main(int argc, char const *argv[]) | |
{ | |
while (1) | |
{ | |
unsigned long amount = pow(2, 3 * 10); /* 1 GB */ |