Subject: pageout not running?
To: None <tech-kern@netbsd.org>
From: Michael B. Schmitz <mbs@seqiro.com>
List: tech-kern
Date: 03/04/2002 05:53:21
I'm compiling lyx.  HW is an Alpha PC164LX with 256MB of RAM.
Gcc dies with an "out of virtual memory" message:

------------------------------------------------------------
c++ -DHAVE_CONFIG_H -I. -I. -I. -I.. -I.. -I../boost
-I/usr/X11R6/include  -I/usr/X11R6/include/X11   -isystem
/usr/X11R6/include  -O2 -mieee -c lyxfunc.C
lyxfunc.C: In method `const class string LyXFunc::Dispatch(int, const
string & = string())':
lyxfunc.C:3027: virtual memory exhausted
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/print/lyx/work/lyx-1.1.6fix4/src
*** Error code 1
-------------------------------------------------------------

This is inside an incredible switch statement with about 5000
lines.  I

Anyway, if I leave vmstat running, it shows the logical size of
the free list decreasing to 57,496 (units of 1K).  After a while
another huge allocation is attempted (I think).  This is at the
place where the runnable procs decreases from 1 to 0.  This is
the instant where gcc, running in another window, gives up with
its "out of virtual memory" error.  Here is the output of vmstat
taken during the compilation.  The compilation starts when the
runnable procs increases from 0 to 1.

--------------------------------------------------------------

bash-2.05# vmstat -w 1
 procs   memory     page                       disks         faults
cpu
 r b w   avm   fre  flt  re  pi   po   fr   sr c0 f0 s0 m0   in   sy  cs
us sy id
 0 0 0 27600 191768  276   2   0    0    0    4  5  0 11  0 1071  641  66
20  4 76
 0 0 0 27600 191768    7   0   0    0    0    0  0  0  0  0 1042    8   2
0  0 100
 0 0 0 27600 191768    5   0   0    0    0    0  0  0  0  0 1035    8   2
0  0 100
 0 0 0 27600 191768    5   0   0    0    0    0  0  0  0  0 1032    8   2
0  0 100
 1 0 0 31520 187560 1685   0   0    0    0    0  0  0  2  0 1045 12180  73
42 54  3
 1 0 0 33720 185360 1051   0   0    0    0    0  0  0 16  0 1054 10601  52
56 38  6
 1 0 0 37328 181752  468   0   0    0    0    0  0  0  0  0 1032  470  15
96  4  0
 1 0 0 41536 177536  545   0   0    0    0    0  0  0  0  0 1032  542  15
96  4  0
 1 0 0 45152 173920  474   0   0    0    0    0  0  0  0  0 1032  458  15
97  3  0
 1 0 0 48880 170184  481   0   0    0    0    0  0  0  0  0 1032  464  16
96  4  0
 1 0 0 51304 167728  313   0   0    0    0    0  0  0  0  0 1032  296  16
98  2  0
 1 0 0 51304 167728    5   0   0    0    0    0  0  0  5  0 1038    8  15
100  0  0
 1 0 0 53608 165424  306   0   0    0    0    0  0  0 28  0 1064  261  15
98  2  0
 1 0 0 57688 161336  523   0   0    0    0    0  0  0  0  0 1032  429  15
96  4  0
 1 0 0 61464 157560  485   0   0    0    0    0  0  0  0  0 1032  395  15
96  4  0
 1 0 0 65120 153896  468   0   0    0    0    0  0  0  0  0 1032  349  15
96  4  0
 1 0 0 67776 151176  344   0   0    0    0    0  0  0  0  0 1032  342  15
97  3  0
 1 0 0 70344 148608  332   0   0    0    0    0  0  0  0  0 1032  299  15
98  2  0
 1 0 0 73808 145136  451   0   0    0    0    0  0  0  0  0 1032  408  15
97  3  0
 1 0 0 75424 143496  233   0   0    0    0    0  0  0  0  0 1032  140  15
99  1  0
 1 0 0 75272 143648   99   0   0    0    0    0  0  0  0  0 1032  119  15
99  1  0
 1 0 0 75304 143616   38   0   0    0    0    0  0  0  0  0 1032   39  16
100  0  0
 1 0 0 79512 139400 1048   0   0    0    0    0  0  0  0  0 1032  258  15
94  6  0
 1 0 0 83128 135744 2345   0   0    0    0    0  0  0  0  0 1032  376  15
86 14  0
 1 0 0 86024 132848 5692   0   0    0    0    0  0  0  0  0 1032  621  17
69 31  0
 1 0 0 89504 129360 4837   0   0    0    0    0  0  0  0  0 1032  391  15
73 27  0
 1 0 0 89656 129208   24   0   0    0    0    0  0  0  0  0 1032    8  15
100  0  0
 1 0 0 90264 128600   81   0   0    0    0    0  0  0  0  0 1032   25  15
100  0  0
 1 0 0 90712 128152   61   0   0    0    0    0  0  0  0  0 1032   64  15
99  1  0
 1 0 0 91296 127568   78   0   0    0    0    0  0  0  0  0 1032   80  15
99  1  0
 1 0 0 91432 127432   22   0   0    0    0    0  0  0  0  0 1033   25  15
100  0  0
 1 0 0 113320 105480 2749   0   0    0    0    0  0  0  0  0 1032  335  15
85 15  0
 1 0 0 113336 105464    7   0   0    0    0    0  0  0  0  0 1032   10  17
100  0  0
 1 0 0 113352 105448    7   0   0    0    0    0  0  0  0  0 1032   10  15
100  0  0
 1 0 0 113376 105424    8   0   0    0    0    0  0  0  2  0 1039   11  15
100  0  0
 1 0 0 113528 105232  456   0   0    0    0    0  0  0  1  0 1037   16  20
97  3  0
 1 0 0 113624 105136   17   0   0    0    0    0  0  0  0  0 1032   20  15
100  0  0
 1 0 0 113688 105072   13   0   0    0    0    0  0  0  0  0 1033   16  15
100  0  0
 1 0 0 113848 104912   25   0   0    0    0    0  0  0  0  0 1032   28  15
100  0  0
 1 0 0 114064 104696   32   0   0    0    0    0  0  0  0  0 1032   35  15
100  0  0
 procs   memory     page                       disks         faults
cpu
 r b w   avm   fre  flt  re  pi   po   fr   sr c0 f0 s0 m0   in   sy  cs
us sy id
 1 0 0 161144 57496 5929   0   0    0    0    0  0  0  0  0 1032   23  15
67 33  0
 1 0 0 161144 57496    5   0   0    0    0    0  0  0  0  0 1042    8  15
100  0  0
 1 0 0 161144 57496    5   0   0    0    0    0  0  0  0  0 1032    8  15
100  0  0
 1 0 0 161144 57496    5   0   0    0    0    0  0  0  1  0 1034    8  16
100  0  0
 1 0 0 161144 57496    5   0   0    0    0    0  0  0  0  0 1032    8  15
100  0  0
 1 0 0 161144 57496    5   0   0    0    0    0  0  0  0  0 1032    8  15
100  0  0
 1 0 0 161144 57496    5   0   0    0    0    0  0  0  0  0 1032    8  15
100  0  0
 1 0 0 161144 57496    5   0   0    0    0    0  0  0  0  0 1032    8  15
100  0  0
 1 0 0 161144 57496    5   0   0    0    0    0  0  0  0  0 1032    8  15
100  0  0
 1 0 0 161144 57496    5   0   0    0    0    0  0  0  0  0 1032    8  16
100  0  0
 1 0 0 161144 57496    5   0   0    0    0    0  0  0  0  0 1032    8  15
100  0  0
 1 0 0 161144 57496    5   0   0    0    0    0  0  0  0  0 1032    8  15
100  0  0
 1 0 0 161144 57496    5   0   0    0    0    0  0  0  0  0 1032    8  15
100  0  0
 1 0 0 161144 57496    5   0   0    0    0    0  0  0  0  0 1032    8  15
100  0  0
 0 0 0 27600 191768   14   0   0    0    0    0  0  0  0  0 1054  124  57
62  6 32
 0 0 0 27600 191768    5   0   0    0    0    0  0  0  0  0 1032    8   2
0  0 100
 0 0 0 27600 191768    5   0   0    0    0    0  0  0  0  0 1032    8   2
0  0 100
 0 0 0 27600 191768    5   0   0    0    0    0  0  0  0  0 1037   95   5
0  0 100
 0 0 0 27600 191768    5   0   0    0    0    0  0  0  0  0 1032    8   2
0  0 100
 0 0 0 27600 191768    5   0   0    0    0    0  0  0  0  0 1032    8   2
0  0 100
^C
-------------------------------------------------------------------------

Before and after this whole process swap usage doesn't change:

-------------------------------------------------------------------------
bash-2.05# swapctl -s
total: 1048576k bytes allocated = 80k used, 1048496k available
-----------------------------------------------------------------

load averages:  0.73,  0.26,  0.17
05:44:01
30 processes:  1 runnable, 28 sleeping, 1 on processor
CPU states: 99.5% user,  0.0% nice,  0.5% system,  0.0% interrupt,  0.0%
idle
Memory: 74M Act, 5416K Inact, 392K Wired, 140M Free, 80K Swp, 1024M Swp
free

  PID USERNAME PRI NICE   SIZE   RES STATE      TIME   WCPU    CPU COMMAND
13272 root      51    0    44M   45M RUN        0:16 95.61% 54.79% cc1plus
13269 root      10    0  1424K 2280K wait       0:00  0.51%  0.29% make
    6 root      18    0     0K   24M syncer     0:32  0.00%  0.00%
[ioflush]
    5 root     -18    0     0K   24M reaper     0:29  0.00%  0.00%
[reaper]
  195 root       2    0   240K  464K select     0:27  0.00%  0.00% telnetd
    7 root     -18    0     0K   24M aiodoned   0:03  0.00%  0.00%
[aiodoned]
13250 root      28    0   280K 1440K CPU        0:00  0.00%  0.00% top
  233 root      18    0   816K  592K pause      0:00  0.00%  0.00% csh
12449 root      18    0   848K  168K pause      0:00  0.00%  0.00% ksh
  224 mbs       18    0   832K    0K pause      0:00  0.00%  0.00% <ksh>
  196 mbs       18    0   832K    0K pause      0:00  0.00%  0.00% <ksh>
  193 mbs       18    0   832K    0K pause      0:00  0.00%  0.00% <ksh>
  306 root      18    0   784K    0K pause      0:00  0.00%  0.00% <csh>
13251 root      10    0  1224K 2088K wait       0:00  0.00%  0.00% make
13252 root      10    0  1160K 2072K wait       0:00  0.00%  0.00% make
23127 root      10    0   872K 1632K wait       0:00  0.00%  0.00% bash
13270 root      10    0   216K 1040K wait       0:00  0.00%  0.00% c++
13253 root      10    0   816K  664K wait       0:00  0.00%  0.00% sh
  191 root      10    0   328K  592K nanoslee   0:00  0.00%  0.00% cron
    1 root      10    0   576K  256K wait       0:00  0.00%  0.00% init
22904 mbs        3    0   856K 1328K ttyin      0:00  0.00%  0.00% bash
23731 mbs        3    0   856K 1168K ttyin      0:00  0.00%  0.00% bash
   95 root       2    0   232K  520K select     0:00  0.00%  0.00% syslogd
22903 root       2    0   240K  464K select     0:00  0.00%  0.00% telnetd
23730 root       2    0   248K  424K select     0:00  0.00%  0.00% telnetd
  185 root       2    0   160K    0K select     0:00  0.00%  0.00% <inetd>
    3 root      -6    0     0K   24M sccomp     0:00  0.00%  0.00%
[pciide0:0]
    2 root      -6    0     0K   24M sccomp     0:00  0.00%  0.00%
[siop0:0]
    4 root     -18    0     0K   24M pgdaemon   0:00  0.00%  0.00%
[pagedaemon]
    0 root     -18    0     0K   24M schedule   0:00  0.00%  0.00%
[swapper]
-----------------------------------------------------------------------

The intersting thing is that as I monitor running processes with top,
that the swapper and pagedaemon never run.  Note also in the vmstat
output that pagein and pageout never happen.  Can some UVM expert
please explain what's going on?

Oh yeah:

---------------------------------------------------------------------
bash-2.05# uname -a
NetBSD metria 1.5ZA NetBSD 1.5ZA (GENERIC) #0: Fri Mar  1 12:06:00 PST
2002     chs@spanky:/build/obj/build/src/sys/arch/alpha/compile/GENERIC
alpha
bash-2.05# cat /etc/fstab
/dev/sd0a / ffs rw 1 2
/dev/sd0b none swap sw 0 0
/dev/sd0d /usr ffs rw 1 1
/dev/sd0f /var ffs rw 1 1
/dev/sd0g /home ffs rw 1 1
---------------------------------------------------------------------

dmesg output gives:

root on sd0a dumps on sd0b

but doesn't mention swap (!?)