Occupies memory! Really, that's the only use.
I use gcc
, I don't know how you compile in clang
or another C compiler, you might want to read their guides.
gcc -o main main.c -lm
Just start without arguments. Occupies as many times as you want.
./main
or start with an argument for size to occupy –like 512M– in bytes. Occupies one time and then exits.
./main $(( 512 * (1024 ** 2) ))