[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Netra X1 strange lock up Debian 3.1, kernel 2.6.12.3



> The box is up for weeks on end you say? But you have no swap added. 
> Could it be linux's 2.6 MM refusing to spawn a new shell due to low mem?

I disabled the swap after the second time it happened on the theory that it
might be thrashing (the machine is remotely located so I can't just listen
for the drive). It dies the same way with or without swap.

Anyway, I tested a program which allocated and initialized memory until there
was none left. The kernel killed it like its supposed to and the system date
didn't change. So, it doesn't seem to be an out of memory condition.

/* malloc memory until I croak */

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

int main (int argc, char **argv)
{
  char *p;

  while (1) {
    p = (char*) malloc (sizeof(char) * 10000);
    if (!p) {
      printf ("Out of memory hit; waiting.\n");
      fflush (stdout);
      sleep (300);
      return 1;
    }
    bzero (p,sizeof(char)*10000);
  }
  return 0;
}

{lily:herrin:/home/h/herrin:!} ./a.out
Killed
{lily:herrin:/home/h/herrin:!}


I have observed that if I have more running it dies sooner. For example, when
I had sendmail and apache running too it would die after a week or ten days.
Now it only dies every few weeks.

-Bill


-- 
William D. Herrin                  herrin@dirtside.com  bill@herrin.us
3005 Crane Dr.                        Web: <http://bill.herrin.us/>
Falls Church, VA 22042-3004



Reply to: