1
0
Files
irix-657m-src/eoe/cmd/memusage/flushmem.c
2022-09-29 17:59:04 +03:00

25 lines
518 B
C

/*
* flushmem - cause most things to page out
*
* This program just mallocs a lot of stuff and then writes to it
* to force the VM system to allocate memory for it. Typically,
* you need to run two or three of these simultaneously to trigger
* all of the flush routines in the kernel.
*
* $Revision: 1.1 $
*/
main()
{
char *buf;
int idx;
for (idx = 0; idx < 10 * 1024; idx++) {
if ((buf = (char *)malloc (4*1024)) == (char *)0) {
perror ("malloc");
exit (2);
}
buf[27] = idx;
}
exit (0);
}