Subject: Re: panic: malloc: out of space in kmem_map
To: Jonathan Stone <jonathan@DSG.Stanford.EDU>
From: Gregory McGarry <gmcgarry@lux.sprc.qut.edu.au>
List: port-pmax
Date: 07/24/1997 19:44:26
Jonathan Stone wrote:
 
> >I always get the following panic when compiling a new kernel on
> >a DS5000/25 with the latest snapshot:
> >
> >  panic: malloc: out of space in kmem_map
> 
> Well, this says you're running out of kernel virtual address space.
> There's no more space in the kernel VM map to allocate more address
> space in KSEG2 (the kernel virtual address space that's mapped via the
> TLB).  This gets used for malloc'ed data, process kernel stacks,
> network mbuf clusters (which are malloc'ed now anyway) and similar things.
> 
> I always configure kernels with NKMEMCLUSETRS=1024 and I've never,
> ever, ever seen this problem, even doing multiple "make -j3"s.  I do
> see it really is a problem and I'd like to fix it, but that's hard
> without knowing why it happens.   Some background that might help:
> 
> How much physical memory does your machine have?  Have you changed
> NKMEMCLUSTERS from the default in the GENERIC config file?  

It is using the latest GENERIC snapshot.  DS5000/25 with 24Mb RAM and
32Mb swap:

  Device      1K-blocks     Used    Avail Capacity  Priority
  /dev/rz2b       32922        0    32922     0%    0

> What else is running on your machine other than the kernel build?  Any
> network servers (innd?)  Are you running an X server?  How many active
> processes do you have?

Not much:

  PID TT  STAT      TIME COMMAND
    0 ??  DLs    0:00.01 (swapper)
    1 ??  Is     0:00.24 /sbin/init 
    2 ??  DL     0:00.02 (pagedaemon)
   88 ??  Ss     0:01.61 syslogd 
   92 ??  Is     0:00.18 portmap 
  131 ??  Ss     0:17.53 update 30 
  133 ??  Ss     0:01.05 cron 
  138 ??  Ss     0:17.75 routed -q 
  148 ??  Is     0:00.20 lpd 
  157 ??  Is     0:00.49 inetd 
  160 ??  I      0:00.37 /usr/X11R6/bin/xdm 
  268 ??  S      0:10.15 telnetd 
  760 ??  I      0:01.55 telnetd 
  269 p0  Is     0:01.03 -sh (sh)
  279 p0  S      0:04.25 sh 
 2229 p0  R+     0:00.18 ps -ax 
  761 p1  Is+    0:01.25 -sh (sh)
  759 ??  Is+    0:00.75 /usr/libexec/getty std.9600 console 

xdm, but no X server.  I am willing to run a patched kernel to obtain
debugging information.  After a couple of panics, the machine eventually
compiled the kernel.  I haven't yet tested a freshly compiled kernel.

I do a straight make depend; make to compile the kernel.

Similar to other panics messages I've seen on the list, the machine
really isn't all that loaded.  In fact, I have only seen it hit the
swap once --- 688k.

I showed a sysadmin around here the process list, and he was impressed
with the efficient memory usage --- his latest Alpha with Digital
UNIX has a 12Mb generic kernel.  Hmmm.

Regards,
Greg