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>
20 main(int ac
, char **av
)
27 printf("eatmem MB [msec/page]\n");
28 printf("specifying msec/page will cause eatmem to loop forever\n");
31 bytes
= strtoul(av
[1], NULL
, 0) * 1024 * 1024;
35 for (i
= 0; i
< bytes
; i
+= 4096) {
37 if (av
[2] && strtol(av
[2], NULL
, 0))
38 usleep(1000 * strtol(av
[2], NULL
, 0));