2 * Infinite loop test with 900,000 processes
4 * Requires system w/ 128GB+ of ram, kern.maxproc=4000000 set in
5 * /boot/loader.conf. 80 second stabilization time after last
8 * Also test tear-down by ^C'ing the test.
10 #include <sys/types.h>
13 #include <sys/resource.h>
24 main(int ac, char **av)
35 for (i = 0; i < COUNT; i += 100) {
37 asprintf(&path, "cp %s /tmp/x%06d", av[0], i);
40 asprintf(&path, "/tmp/x%06d", i);
42 asprintf(&path, "%s", av[0]);
44 asprintf(&id, "%d", i);
46 execl(path, path, id, NULL);
50 printf("running %d\r", i);
57 idno = strtol(av[1], NULL, 0);
58 setpriority(PRIO_PROCESS, 0, 5);
59 for (j = 0; j < 100; ++j) {
60 if (j == 99 || fork() == 0) {
63 setpriority(PRIO_PROCESS, 0, 15);
72 while (wait3(NULL, 0, NULL) >= 0 || errno == EINTR)
76 printf("running %d\n", i);