Re: [PROBLEM] Badness in out_of_memory (Plain)

From: Andrea Arcangeli
Date: Thu Jan 06 2005 - 19:04:45 EST


On Thu, Jan 06, 2005 at 06:51:18PM +0100, Richard Ems wrote:
> this! Do you know a memory eater program other than starting lots of
> mozilla's, OpenOffices's, etc.?

You can run a few of this.

#include <stdio.h>
#include <time.h>

main()
{
char *p[160];
int i, j;
int count;
for (j=0; j<160; j++)
{
p[j] = (char *) malloc(10000000);
}
for (count=0;count<2000;count++)
{
for (j=0; j<160; j++)
{
for (i=0; i<10000000; i+= 4096)
p[j][i] = 0;
}
pause();
}
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/