[BUG] oom killer not triggering in 2.6.9-rc3

From: Chris Friesen
Date: Fri Oct 08 2004 - 19:15:10 EST



I have an Xserve running 2.6.9-rc3 and patched to run the ppc kernel rather than the ppc64 kernel. It's configured with 2GB of memory, no swap.

If I run one instance of the following program, it allocates all but about 3MB of memory, and the memory hog spins with 100% of the cpu.

If I run two instances of the program, the machine locks up, doesn't respond to pings, and is basically dead to the world.

Shouldn't the oom-killer be kicking in?

Chris







#include <stdlib.h>
#include <unistd.h>

#define PAGES 1000
#define BLOCKSIZE (pgsz * PAGES)

int main()
{
int pgsz = sysconf(_SC_PAGESIZE);

while(1) {
char *p = (char *)malloc(BLOCKSIZE);
if (p)
for (int i=0;i<PAGES;i++)
*(p+(i*pgsz)) = 1;
}
return 0;
}
-
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/