Subject: Re: Sun 3/60 [NetBSD 1.2] keeps on booting.
To: None <port-sun3@NetBSD.ORG>
From: Jari Kokko <jkokko@cpcemail.ntc.nokia.com>
List: port-sun3
Date: 01/16/1997 08:30:36
In article <5bi10r$un6$1@bilbo.ntc.nokia.com>,
Jari Kokko <jkokko@cpcemail.ntc.nokia.com> wrote:
> Well, I have the options at 7, and it seems to work for me... Mind
> you, the machine is under little load and memory use most of the time.
> Swap is at 25% or so mostly. I only get hit by the everything-dumps
> bug when I really use swap, like running xv -wait 1 for dozens of big
> images. Usually, some big process, like emacs, when used after that is
> in a non-deterministic state, but nothing else is affected, except
> rarely, when everything starts dumping core.
Setting options to 5 removed the bug on my system completely. I
exercised the kernel swapper by running two 10MB+ xv's and an
allocator program the same time. The system survived just fine.
Thanks for the emailed suggestion. I had tried options at 1 3 and 7
before, but not 5, because if the comment that says that interesting
values are 1, 3, 7.
Jari Kokko
PS. Short allocator program source follows (use e.g.'limit 10m' before
running it!)
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
typedef struct { char megabyte[1024*1024]; } Meg;
main()
{
Meg *megs[10240];
static Meg onemeg;
int i;
fprintf(stderr, "Each `.' means %d bytes.\n", sizeof (onemeg));
fputs("allocating\t", stderr);
for (i=0 ; ; i++) {
megs[i]=malloc(sizeof (onemeg));
if (megs[i] == 0) break;
putc('.', stderr);
}
fputs("\ncopying\t\t", stderr);
for (i=0; megs[i]; i++) {
memcpy(megs[i], &onemeg, sizeof (onemeg));
putc('.', stderr);
}
fputs("\nfreeing\t\t", stderr);
for (i=0; megs[i]; i++) {
free(megs[i]);
putc('.', stderr);
}
putchar('\n');
}