*BSD News Article 59109


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.bhp.com.au!mel.dit.csiro.au!munnari.OZ.AU!spool.mu.edu!howland.reston.ans.net!tank.news.pipex.net!pipex!news.mathworks.com!fu-berlin.de!news.belwue.de!news.uni-stuttgart.de!news.ruhr-uni-bochum.de!news.rwth-aachen.de!genesis.westend.com!news2.gtn.com!news.gtn.com!knobel.gun.de!usenet
From: andreas@knobel.gun.de (Andreas Klemm)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: 2.1.0 uses lots of swap space
Date: 7 Jan 1996 11:22:04 GMT
Lines: 188
Message-ID: <4coacs$cn@knobel.gun.de>
References: <87ybrnp2yy.fsf@compi.hobby.nl>
NNTP-Posting-Host: knobel.gun.de
X-Newsreader: knews 0.9.3
In-Reply-To: <87ybrnp2yy.fsf@compi.hobby.nl>
To: plm@compi.hobby.nl (Peter Mutsaers)

In article <87ybrnp2yy.fsf@compi.hobby.nl>,
	plm@compi.hobby.nl (Peter Mutsaers) writes:
>Hello,
>
>I'm wondering why FreeBSD 2.1.0 uses so much swap space. I'm plagued
>by messages indicating I have no more virtual memory.

Depends on the amount of services you use ....

>At the moment pstat -s reports that 15M swap space is in use. I have
>16MB RAM, of which I estimate at least 14MB to be available. Top
>reports that only 256KB RAM is free, so the total
>amount of virtual memory used is 29MB.

Well, I'm running an NNTP server (inn), am running X11, ...
  PID  TT  STAT      TIME COMMAND
    0  ??  DLs    0:00.00  (swapper)
    1  ??  IWs    0:00.02 /sbin/init --
    2  ??  DL     0:00.08  (pagedaemon)
    3  ??  DL     0:00.26  (vmdaemon)
    4  ??  DL     0:01.84  (update)
   23  ??  SWs    0:00.18 mfs /dev/sd0s3b /tmp (mount_mfs)
   26  ??  IWs    0:00.00 adjkerntz -i
   51  ??  IWs    0:00.07 routed -q
   70  ??  SWs    0:00.28 syslogd
   73  ??  IWs    0:00.03 named -b /etc/namedb/named.boot
   78  ??  IWs    0:00.00 portmap
   87  ??  IWs    0:00.27 inetd
   94  ??  IWs    0:00.14 cron
   96  ??  IWs    0:00.03 lpd
  102  ??  IWs    0:00.16 sendmail: accepting connections (sendmail)
  176  ??  Ss     0:01.53 /usr/local/sbin/httpd
  180  ??  IW     0:00.00 /usr/local/sbin/httpd
  181  ??  IW     0:00.00 /usr/local/sbin/httpd
  182  ??  IWs    0:01.38 /usr/local/news/etc/innd -p4 -i0
  190  ??  IW     0:00.01 /usr/libexec/getty std.57600 ttyd1
  197  ??  S      0:43.65 X :0 (XF86_S3)
  407  ??  IW     0:00.42 -knobel.gun.de BODY                                  
  920  ??  Ss     0:00.33 xterm -e vi +9 /var/tmp/tmp.6.000406
  265  p0  IWs+   0:00.71 -su (tcsh)
  271  p0  IW     0:00.10 xconsole
  918  p2  IWs    0:00.48 -csh (tcsh)
  919  p2  S+     0:00.29 top
  921  p3  Ss+    0:00.19 vi -c9 /var/tmp/tmp.6.000406
  922  p3  S+     0:00.43 tcsh -c ps -ax
  923  p3  Z+     0:00.00  (vi)
  924  p3  R+     0:00.01 ps -ax
  186  v0  IWs    0:00.53 -tcsh (tcsh)
  196  v0  IW+    0:00.05 xinit
  198  v0  IW     0:00.02 sh /home/andreas/.xinitrc
  203  v0  IW     0:01.65 /usr/X11R6/bin/fvwm
  204  v0  IW     0:00.16 /usr/X11R6/lib/X11/fvwm/FvwmButtons 7 4 .fvwmrc 0 8
  209  v0  S      0:02.21 xclock
  210  v0  S      0:00.78 xload
  211  v0  IW     0:00.15 /usr/X11R6/lib/X11/fvwm/FvwmPager 9 4 .fvwmrc 0 8 0 0
  264  v0  IW     0:00.30 xterm -e su -
  406  v0  IW     0:02.57 knews
  917  v0  S      0:00.26 xterm
  187  v1  IWs+   0:00.01 /usr/libexec/getty Pc ttyv1
  188  v2  IWs+   0:00.01 /usr/libexec/getty Pc ttyv2
  189  v3  IWs+   0:00.01 /usr/libexec/getty Pc ttyv3

FreeBSD isn't a toy OS ;-) Here what top says:

load averages:   0.25,  0.20,  0.10                                    12:10:34
38 processes:  1 running, 37 sleeping
Cpu states:  2.3% user,  0.0% nice,  0.0% system,  0.0% interrupt, 97.7% idle
Mem: 23M Active, 1008K Inact, 5468K Wired, 744K Cache, 3444K Buf, 684K Free
Swap: 98M Total, 1056K Used, 97M Free, 1% Inuse  

  PID USERNAME PRI NICE  SIZE   RES STATE    TIME   WCPU    CPU COMMAND
  917 andreas    2    0  460K  884K select   0:00  1.88%  1.87% xterm
  197 andreas    2    0 3972K 4720K select   0:44  1.37%  1.37% XF86_S3
  919 andreas   28    0  328K  600K RUN      0:00  0.00%  0.00% top

I have 32 MB RAM and 96 MB swap .... If I'm running many X11 Programs,
as xv, knews, 3 xterms, netscape, elm in an xterm, pine running on
huge mail folders, I need even more ...

Note the huge pine process when opening my FreeBSD-hackers mailinglist
folder with 3080 messages in it (12.11.95 - now):

USER       PID %CPU %MEM   VSZ  RSS  TT  STAT STARTED       TIME COMMAND
andreas   1016 19.3  3.6   892 1108  p3  S+   12:15PM    0:00.46 tcsh -c ps -ax
root       197  2.1 22.8  7732 7068  ??  S    10:09AM    1:09.03 X :0 (XF86_S3)
root         1  0.0  0.4   412  108  ??  Ss   11:06AM    0:00.03 /sbin/init --
root         2  0.7  0.1     0   12  ??  RL   11:06AM    0:03.93  (pagedaemon)
root         3  0.0  0.1     0   12  ??  DL   11:06AM    0:01.31  (vmdaemon)
root         4  0.0  0.1     0   12  ??  DL   11:06AM    0:01.96  (update)
root        23  0.0  0.1 98632   24  ??  Ss   11:06AM    0:00.19 mfs /dev/sd0s3
root        26  0.0  0.0   200    0  ??  IWs  11:06AM    0:00.00 adjkerntz -i
root        51  0.0  0.3   184   96  ??  Is   10:06AM    0:00.08 routed -q
root        70  0.0  0.4   192  104  ??  Ss   10:06AM    0:00.29 syslogd
root        73  0.0  0.0   500    0  ??  IWs  10:06AM    0:00.03 named -b /etc/
daemon      78  0.0  0.0   176    0  ??  IWs  10:06AM    0:00.00 portmap
root        87  0.0  0.0   196    0  ??  IWs  10:06AM    0:00.27 inetd
root        94  0.0  0.4   236  120  ??  Is   10:06AM    0:00.15 cron
root        96  0.0  0.0   204    0  ??  IWs  10:06AM    0:00.03 lpd
root       102  0.0  0.4   512  124  ??  Is   10:06AM    0:00.17 sendmail: acce
root       176  0.0  0.3   320   88  ??  Ss   10:06AM    0:01.61 /usr/local/sbi
nobody     180  0.0  0.0   320    0  ??  IW   10:06AM    0:00.00 /usr/local/sbi
nobody     181  0.0  0.0   320    0  ??  IW   10:06AM    0:00.00 /usr/local/sbi
news       182  0.0  0.0   664    0  ??  IWs  10:06AM    0:01.39 /usr/local/new
andreas    186  0.0  0.0   988    0  v0  IWs  10:06AM    0:00.53 -tcsh (tcsh)
root       187  0.0  0.0   156    0  v1  IWs+ 10:06AM    0:00.01 /usr/libexec/g
root       188  0.0  0.0   156    0  v2  IWs+ 10:06AM    0:00.01 /usr/libexec/g
root       189  0.0  0.0   156    0  v3  IWs+ 10:06AM    0:00.01 /usr/libexec/g
andreas    196  0.0  0.0   176    0  v0  IW+  10:09AM    0:00.05 xinit
andreas    198  0.0  0.0   480    0  v0  IW   10:09AM    0:00.02 sh /home/andre
andreas    203  0.0  1.4   452  416  v0  I    10:09AM    0:02.89 /usr/X11R6/bin
andreas    204  0.0  0.6   252  192  v0  I    10:09AM    0:00.20 /usr/X11R6/lib
andreas    209  0.0  0.7   208  200  v0  S    10:09AM    0:02.34 xclock
andreas    210  0.0  0.8   248  232  v0  S    10:09AM    0:00.83 xload
andreas    211  0.0  0.6   220  192  v0  I    10:09AM    0:00.32 /usr/X11R6/lib
root       264  0.0  1.0   460  288  v0  I    10:13AM    0:00.36 xterm -e su -
root       265  0.0  0.0  1012    0  p0  IWs+ 10:13AM    0:00.73 -su (tcsh)
root       271  0.0  1.0   216  308  p0  I    10:13AM    0:00.15 xconsole
andreas    406  0.0  1.3   720  380  v0  I    10:17AM    0:02.85 knews
news       407  0.0  0.0   352    0  ??  IW   10:17AM    0:00.42 -knobel.gun.de
root       917  0.0  1.1   460  320  v0  I    12:08PM    0:00.77 xterm
andreas    918  0.0  0.0   964    0  p2  IWs+ 12:08PM    0:00.49 -csh (tcsh)
root       920  0.0  1.4   460  432  ??  Ss   12:09PM    0:00.78 xterm -e vi +9
andreas    921  0.0  1.6   520  496  p3  Ss+  12:09PM    0:00.59 vi -c9 /var/tm
andreas    975  0.0  8.4  5128 2596  v0  I    12:12PM    0:04.03 netscape
root       979  0.0  1.0   428  316  ??  Ss   12:12PM    0:00.27 ppp -auto onde
root       986  0.0  0.0   468    0  p0  IW   12:12PM    0:00.08 /bin/csh -f /u
nobody    1001  0.0  2.6  2088  792  p0  S    12:12PM    0:00.43 cached -s -f /
root      1003  0.0  1.3   480  404  v0  S    12:13PM    0:00.29 xterm -e /usr/
andreas   1004  0.0  8.6 17348 2664  p4  Ss+  12:13PM    0:14.36  (pine)
andreas   1007  0.0  1.9  1696  588  v0  I    12:13PM    0:00.51 xv
root      1008  0.0  0.0   156    0  p0  IW   12:13PM    0:00.03 (dnsserver) -p
root      1009  0.0  0.0   156    0  p0  IW   12:13PM    0:00.03 (dnsserver) -p
root      1010  0.0  0.0   156    0  p0  IW   12:13PM    0:00.03 (dnsserver) -p
root      1015  0.0  1.4   156  416  ??  S    12:15PM    0:00.01 /usr/libexec/g
andreas   1017  0.0  0.0     0    0  p3  Z+   -          0:00.00  (vi)
andreas   1018  0.0  0.7   468  212  p3  R+   12:15PM    0:00.01 ps -axu
root         0  0.0  0.0     0    0  ??  DLs  -          0:00.00  (swapper)

Here, what top says:

load averages:   0.20,  0.30,  0.18                                    12:16:36
48 processes:  3 running, 45 sleeping
Cpu states:  0.8% user,  0.0% nice,  1.6% system,  0.8% interrupt, 96.9% idle
Mem: 20M Active, 4028K Inact, 4032K Wired, 2676K Cache, 4332K Buf, 80K Free
Swap: 98M Total, 40M Used, 58M Free, 41% Inuse  

  PID USERNAME PRI NICE  SIZE   RES STATE    TIME   WCPU    CPU COMMAND
  197 andreas    2    0 7732K 7068K select   1:10  3.36%  3.36% XF86_S3
 1019 andreas   28    0  304K  696K RUN      0:00  0.23%  0.15% top
 1007 andreas    2    0 1696K  588K select   0:00  0.11%  0.11% xv
  203 andreas    2    0  452K  420K select   0:02  0.11%  0.11% fvwm


Device      1K-blocks     Used    Avail Capacity  Type
/dev/sd0s3b     98304    40416    57824    41%    Interleaved

So if you are running X11 you should use at least 64 MB swap space ...
Sun's default SUNOS 4.1.3 installations on SS IPX use 66 MB swap space
on a 400 MB Harddisk ...

Similar is FreeBSD I'd say ....

	root	32 MB
	swap	66 MB
	usr	Rest ...

Or if you have some disk space:

Filesystem  1K-blocks     Used    Avail Capacity  Mounted on
/dev/sd0a       31775    16662    12571    57%    /
/dev/sd0s3d   1487316   938894   429436    69%    /local
/dev/sd0s3e     63567    13706    44775    23%    /var
/dev/sd0s3f    254319    10722   223251     5%    /news
/dev/sd0s3g    127151     4739   112239     4%    /www
/dev/sd0s3h   1017327   704638   231302    75%    /usr


Have space and fun ;-)

	Andreas ///

-- 
andreas@knobel.gun.de       /\/\___  Wiechers & Partner Datentechnik GmbH
   Andreas Klemm        ___/\/\/       - Support Unix - aklemm@wup.de -
                             \/
       ftp://sunsite.unc.edu/pub/Linux/system/Printing/aps-491.tgz
apsfilter - magic print filter 4lpd  >>> knobel is powered by FreeBSD <<<