Subject: panic: malloc: out of space in kmem_map
To: Gregory McGarry <gmcgarry@lux.sprc.qut.edu.au>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: port-pmax
Date: 07/24/1997 02:27:29
Gregory McGarry <gmcgarry@lux.sprc.qut.edu.au> writes:

>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

>Any ideas?


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.


To address your immediate problem, how to build a new kernel:
  If you're using make -j, don't.

  If you're using cc -pipe, don't.

  If that doesn't help, try building the kernel in single-user
  mode. (you can run mount filesystems, ru /etc/netstart and
  mount NFS filesystems, course.)

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?  

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?


--Jonathan