Subject: Re: Bad response...
To: None <mason@primenet.com.au>
From: Richard Earnshaw <rearnsha@netbsd.org>
List: current-users
Date: 08/27/2004 14:01:15
On Fri, 2004-08-27 at 13:24, Geoff Wing wrote:
> Wouter Klouwen <dublet@dublet.org> typed:
> : I'm running a -current kernel on my laptop, which has 256MB of internal
> : memory, and a quite slow HDD. The filecache is usually ~170MB, this is
> : really way too much,
> 
> Umm, "too much"?  What do you expect your memory to be doing?  If you have
> free memory after hours of use then you've wasted money buying stuff you're
> not using.  It's great that it's using the memory you've paid for.  If you
> have a complaint then it can only be because it didn't prioritise memory
> usage properly.  Since you haven't indicated that that was the problem
> you seem to have not quite understood what benefits of RAM are.  Or maybe
> just haven't indicated that you've understood them.

I don't care about memory being used for buffering files when there's no
other use for it.  I do care about memory being held 'in reserve' when a
process is thrashing the hell out of a disk.

I have a machine with 64M of ram.  The kernel 'processes' (as shown in
top) used to take about 4M of that, maybe less until late last year. 
These days top shows the kernel hogging 18M of ram at present.  It never
drops, even when the machine starts thrashing.

Here's a dump of the pools:

Memory statistics by bucket size
    Size   In Use   Free   Requests  HighWater  Couldfree
      16      661    619  183548634    1280          0
      32      501    139  101128095     640          0
      64      633   1287  238843949     320     114162
     128      303     81   26248710     160          0
     256      100    524   43316622      80    1096311
     512       59     45   40450386      40    1292929
    1024      414     66   33857836      20   12354492
    2048       45     29   19870742      10    9503376
    4096       29     51    2466810       5    2463803
    8192        2     30    3171553       5    3169218
   16384        7      0    1979590       5          0
   32768        1      0      19869       5          0
   65536        2      0       3524       5          0
  131072        0      0       3098       5          0
  262144        0      0       1444       5          0
  524288        0      0          3       5          0

Memory usage type by bucket size
    Size  Type(s)
      16  VM swap, UVM aobj, UVM amap, ifaddr, soname, pipe, in_multi,
	  ip_moptions, routetbl, temp, pcb, devbuf, exec
      32  VM swap, UVM amap, ether_multi, ifaddr, vnodes, soname, sysctldata,
	  proc, fragtbl, routetbl, temp, pcb, devbuf, exec
      64  UVM amap, vnodes, pipe, prop, in_multi, routetbl, temp, pcb, DMA map,
	  devbuf, NFS diroff, NFS req, NDP
     128  VM swap, UVM amap, ifaddr, soname, ttys, pipe, prop, sysctlnode,
	  routetbl, temp, devbuf, kevent, inodedep, NDP
     256  VM map, UVM amap, ifaddr, vnodes, pipe, subproc, proc, routetbl, temp,
	  exec, kevent, file desc, newblk, NFS diroff
     512  UVM amap, ifaddr, proc, UFS mount, temp, pcb, devbuf, exec, ioctlops,
	  file desc, NFS mount, ISOFS mount
    1024  UVM aobj, UVM amap, namei, ttys, sysctlnode, proc, UFS mount, temp,
	  devbuf, exec, kevent, NQNFS Lease
    2048  VM pmap, UVM amap, ifaddr, namecache, sysctlnode, in_multi, UFS mount,
	  temp, devbuf, exec
    4096  UVM amap, mount, sysctlnode, UFS mount, temp, devbuf, pagedep
    8192  UVM amap, sysctlnode, UFS mount, temp, MSDOSFS mount
   16384  UVM amap, namecache, sysctlnode, UFS mount, inodedep, NFS node,
	  ISOFS mount
   32768  UVM amap, UFS mount
   65536  UVM amap, temp, devbuf
  131072  UVM amap
  262144  UVM amap
  524288  UVM amap

Memory statistics by type                           Type  Kern
         Type  InUse MemUse HighUse  Limit Requests Limit Limit Size(s)
       VM swap     5     1K      1K  4301K        5    0     0  16,32,128
       VM pmap     1     2K      2K  4301K        1    0     0  2048
        VM map     4     1K      1K  4301K        4    0     0  256
      UVM aobj     2     2K      2K  4301K        2    0     0  16,1024
      UVM amap  1348   194K   1835K  4301K580397389    0     0  16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,262144,524288
   ether_multi     5     1K      1K  4301K        5    0     0  32
        ifaddr    18     6K      6K  4301K       18    0     0  16,32,128,256,512,2048
         mount     9    36K     44K  4301K       59    0     0  4096
        vnodes    41     6K     69K  4301K   467769    0     0  32,64,256
         namei     0     0K      1K  4301K       17    0     0  1024
     namecache     3    34K     34K  4301K        3    0     0  2048,16384
        soname     7     1K      2K  4301K    22293    0     0  16,32,128
          ttys   566   368K    368K  4301K      566    0     0  128,1024
          pipe     0     0K      1K  4301K      114    0     0  16,64,128,256
          prop     2     1K      1K  4301K        2    0     0  64,128
    sysctldata     0     0K      1K  4301K        2    0     0  32
    sysctlnode    45    75K     75K  4301K       63    0     0  128,1024,2048,4096,8192,16384
       subproc    14     4K      5K  4301K     3756    0     0  256
          proc     4     2K      2K  4301K      768    0     0  32,256,512,1024
      in_multi    25     3K      3K  4301K       25    0     0  16,64,2048
   ip_moptions     1     1K      1K  4301K        1    0     0  16
     UFS mount    18    66K     66K  4301K       22    0     0  512,1024,2048,4096,8192,16384,32768
       fragtbl     0     0K      1K  4301K   164088    0     0  32
      routetbl    58     4K      5K  4301K      620    0     0  16,32,64,128,256
          temp   285    61K     72K  4301K 81079179    0     0  16,32,64,128,256,512,1024,2048,4096,8192,65536
           pcb    35     5K      5K  4301K    22762    0     0  16,32,64,512
       DMA map     2     1K      1K  4301K        2    0     0  64
        devbuf   167    71K     73K  4301K     8564    0     0  16,32,64,128,512,1024,2048,4096,65536
          exec     3     1K     10K  4301K 31787422    0     0  16,32,256,512,1024,2048
        kevent     3     2K      3K  4301K   508192    0     0  128,256,1024
      ioctlops     0     0K      1K  4301K      140    0     0  512
     file desc     9     5K      7K  4301K    11553    0     0  256,512
        newblk     1     1K      1K  4301K        1    0     0  256
      inodedep     1    16K     24K  4301K     6836    0     0  128,16384
       pagedep     1     4K      4K  4301K        1    0     0  4096
     NFS mount     5     3K      3K  4301K       47    0     0  512
    NFS diroff    61     6K    133K  4301K     3012    0     0  64,256
       NFS req     0     0K      1K  4301K   425555    0     0  64
   NQNFS Lease     1     1K      1K  4301K        1    0     0  1024
      NFS node     1    16K     16K  4301K        1    0     0  16384
 MSDOSFS mount     1     8K      8K  4301K        1    0     0  8192
   ISOFS mount     1    16K     17K  4301K        3    0     0  512,16384
           NDP     4     1K      1K  4301K        5    0     0  64,128

Memory totals:  In Use    Free    Requests
                 1010K    827K    694910869

Memory resource pool statistics
Name        Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle
phpool        40    57529    0    57263    23    19     4     5     0   inf    0
pcgpool      140    26075    0    26061     3     2     1     2     0   inf    0
pmappl      1080     9087    0     9035   515   496    19    22     0   inf    1
pvepl         16 2372304597  0 2372295804  97    32    65    84     3   inf    0
l2dtblpl     196    34106    0    33971  1469  1460     9    11     2   inf    1
l2ptppl     1024    50092    0    49895  3300  3239    61   100     4   inf    0
inpcbpl      108    10614    0    10561     2     0     2     2     0   inf    0
inmltpl       32        2    0        0     1     0     1     1     0   inf    0
ipqepl        44   983199    0   983199   154   153     1     1     0   inf    1
synpl        184      381    0      381    97    96     1     1     0   inf    1
tcpcbpl      316     3098    0     3055    11     7     4     5     0   inf    0
in6pcbpl     156     1538    0     1518     1     0     1     1     0   inf    0
cd9660nopl   152     3481    0     3481    28    28     0    26     0   inf    0
nfsnodepl    296    38100    0    38090   548   546     2   292     0   inf    1
nfsvapl      108    38100    0    38090   149   148     1   103     0   inf    0
sdpcpool     120 15127410    0 15127409  5014  5012     2    49     0   inf    1
pagedeppl     68   359046    0   359046  1603  1602     1    11     0   inf    1
inodedeppl    88  5897702    0  5897701 11146 11145     1   358     0   inf    0
newblkpl      36 17237531    0 17237531  1242  1241     1     1     0   inf    1
bmsafemappl   36  1410935    0  1410934   934   933     1     1     0   inf    0
allocdirectpl 80  9371613    0  9371612  3734  3732     2    34     0   inf    1
indirdeppl    32   263949    0   263949   637   636     1     1     0   inf    1
allocindirpl  64  7865918    0  7865918 10168 10160     8    35     0   inf    8
freefragpl    40   743051    0   743051  1323  1322     1     1     0   inf    1
freeblkspl   172  3175366    0  3175365 13967 13966     1   404     0   inf    0
freefilepl    36  4808319    0  4808319  3753  3752     1    83     0   inf    1
diraddpl      36  5125427    0  5125427  2338  2337     1    13     0   inf    1
mkdirpl       32   152530    0   152530   772   771     1     7     0   inf    1
dirrempl      36  5118769    0  5118769  4297  4296     1    80     0   inf    1
newdirblkpl   20    13741    0    13741   698   697     1     1     0   inf    1
ffsinopl     176 90990308    0 90982870  6064  5739   325   335     0   inf    0
dino1pl      128 90990308    0 90982870  4363  4122   241   249     0   inf    0
rndsample    528   942502    0   942500     1     0     1     1     0   inf    0
filepl        56 259708140   0 259707966  135   132     3     4     0   inf    0
cwdipl        12 18440743    0 18440706     1     0     1     1     0   inf    0
fdescpl      280 18440743    0 18440706   118   113     5     5     0   inf    1
kqueuepl     260       61    0       60     1     0     1     1     0   inf    0
knotepl       72      140    0      128     1     0     1     1     0   inf    0
procpl       408 18440751    0 18440706   659   652     7     8     0   inf    1
lwppl        124 18443416    0 18443371    98    95     3     3     0   inf    1
pgrppl        16   730360    0   730328     1     0     1     1     0   inf    0
pcredpl       24 18440751    0 18440706     1     0     1     1     0   inf    0
plimitpl     172     5668    0     5660     1     0     1     1     0   inf    0
pstatspl     224 18440751    0 18440706   888   884     4     4     0   inf    0
rusgepl       72 18440706    0 18440706  1772  1771     1     1     0   inf    1
raspl         20     4637    0     4637    24    23     1     1     0   inf    1
sadatapl      40     2648    0     2648    22    22     0     1     0   inf    0
saupcpl      568    11437    0    11437    22    22     0     1     0   inf    0
sastackpl     24    42368    0    42368    22    22     0     1     0   inf    0
savppl        52     2648    0     2648    22    22     0     1     0   inf    0
ptimerpl     124     6404    0     6390     1     0     1     1     0   inf    0
sessionpl     40   728501    0   728473     1     0     1     1     0   inf    0
credpl        80 66154978    0 66154948     1     0     1     1     0   inf    0
sigapl      2052 18440743    0 18440706  9098  9041    57    64     0   inf   20
siginfo      128     8669    0     8669    19    19     0     1     0   inf    0
pipepl       140 22743188    0 22743153    38    36     2     3     0   inf    0
ttypl        264      113    0        0     8     0     8     8     0   inf    0
sockpl       200    34900    0    34806    55    49     6     6     0   inf    1
ncachepl      84 89535830    0 89528971  3251  3101   150   161     0   inf    6
lockfpl       52   718868    0   718864     1     0     1     1     0   inf    0
vnodepl      164  4820406    0  4812947  1667  1355   312   322     0   inf    0
rtentpl      132       49    0       23     1     0     1     1     0   inf    0
amappl        40 153892386   0 153891941  237   230     7     7     0   inf    1
uaoeltpl      84    11997    0    11987     1     0     1     1     0   inf    0
aobjpl        52        1    0        0     1     0     1     1     0   inf    0
vmsppl       220 18440737    0 18440700   241   237     4     4     0   inf    1
vmmpepl       88 560826204   0 560824850 8913  8875    38    71     0   inf    4
vmmpekpl      88 18272761    0 18272660   112   105     7     8     0   inf    1
bufpl        120 48360022    0 48356406  7803  7693   110   123     0   inf    0
buf1k       1024  2099845    0  2097186  4417  4373    44    49     1   inf    0
buf2k       2048   325376    0   325261  2819  2815     4    26     1   inf    0
buf4k       4096   109667    0   109636  2538  2535     3    10     1   inf    0
buf8k       8192  1814843    0  1814033 36652 36523   129   232     1   inf    1
mbpl         256    51795    0    51726   329   323     6    14     1   inf    0
mclpl       2048    13173    0    13165  6792  6784     8    47     4   512    4
pnbufpl     1024     6417    0     6413    20    19     1     2     0   inf    0
wdcspl        52 60320043    0 60320043    10     9     1     1     0   inf    1
extent        20 28346960    0 28346150   233   199    34    48     0   inf    0

In use 14733K, total allocated 17724K; utilization 83.1%

There's a large number of these pools that seem to be pretty large and
close to their high water marks.  That suggests to me that they are
hanging onto their memory when they should perhaps be freeing it up for
better uses.

R.