4 * (c)Copyright 2003 Matthew Dillon <dillon@backplane.com>. This code is
5 * hereby placed in the public domain.
7 * This program 'eats' memory by allocating and touching it. Make sure your
8 * datasize resource limit is sufficient for the amount of memory you specify.
10 * $DragonFly: src/test/stress/eatmem.c,v 1.1 2003/08/25 19:41:00 dillon Exp $
12 #include <sys/types.h>
19 main(int ac, char **av)
26 printf("eatmem MB [msec/page]\n");
27 printf("specifying msec/page will cause eatmem to loop forever\n");
30 bytes = strtol(av[1], NULL, 0) * 1024 * 1024;
34 for (i = 0; i < bytes; i += 4096) {
36 if (av[2] && strtol(av[2], NULL, 0))
37 usleep(1000 * strtol(av[2], NULL, 0));