Jump to content

Swap not being flushed


Recommended Posts

The sys has been up all night downloading iso's with d4x (nt) and as I went to answer some post this morning things seemed a little slow, but when I went to start konqueror the sys came to it's knees. My swap has never been more that 25% used but now it's only 25% free :shock: as I write this.

 

Any idea how to manually flush the swap? Is it a bad idea? Any thought appreciated!

[root@localhost bvc]# free

            total       used       free     shared    buffers     cached

Mem:        190980     166212      24768          0       4512      42472

-/+ buffers/cache:     119228      71752

Swap:       401584     376216      25368

[root@localhost bvc]# procinfo

Linux 2.4.19-16 (root@localhost.localdomain) (gcc 3.2 ) #1 Sat Feb 15 14:17:34 CST 2003 1CPU [localhost.localdomain]



Memory:      Total        Used        Free      Shared     Buffers      Cached

Mem:        190980      166260       24720           0        4528       42472

Swap:       401584      376216       25368



Bootup: Sun Mar 30 01:54:46 2003    Load average: 0.05 0.14 0.64 1/42 24804



user  :       1:13:29.78  15.2%  page in :  1463270  disk 1:      215r       9w

nice  :       0:02:56.62   0.6%  page out:   982898  disk 2:   136054r   86163w

system:       0:26:49.45   5.5%  swap in :    32541

idle  :       6:21:40.72  78.7%  swap out:   116330

uptime:       8:04:56.56         context : 10537715



irq  0:   2909657 timer                 irq  8:         1 rtc                  

irq  1:      7307 keyboard              irq  9:   1742152 acpi, nvidia         

irq  2:         0 cascade [4]           irq 11:     43022 usb-uhci, Crystal CS 

irq  4:  17609213                       irq 14:    203146 ide0                 

irq  6:         3                       irq 15:        24 ide1

[root@localhost bvc]# ps -A

 PID TTY          TIME CMD

   1 ?        00:00:04 init

   2 ?        00:00:00 keventd

   3 ?        00:00:00 ksoftirqd_CPU0

   4 ?        00:03:47 kswapd

   5 ?        00:00:00 bdflush

   6 ?        00:00:03 kupdated

   9 ?        00:00:00 kreiserfsd

  41 ?        00:00:10 minilogd

 133 ?        00:00:00 devfsd

 217 ?        00:00:00 khubd

 379 ?        00:00:00 i2oevtd

 381 ?        00:00:00 i2oblock

 700 ?        00:00:01 gpm

 780 ?        00:00:11 xfs

 796 ?        00:00:00 prefdm

 811 ?        00:00:00 autologin

 819 ?        00:00:00 atd

 883 ?        00:00:02 cupsd

 909 ?        00:00:00 startx

 922 ?        00:00:00 xinit

 924 ?        00:24:47 X

1132 ?        00:00:00 crond

1221 ?        00:00:09 waimea

1222 ?        00:00:00 .xinitrc

1227 ?        00:00:11 artsd

1236 ?        00:00:00 wampager

1317 vc/1     00:00:00 mingetty

1319 vc/3     00:00:00 mingetty

1320 vc/4     00:00:00 mingetty

1321 vc/5     00:00:00 mingetty

1324 vc/6     00:00:00 mingetty

1346 ?        00:00:28 gkrellm

1370 ?        00:00:00 idesk

24718 vc/2     00:00:00 mingetty

24721 ?        00:00:00 aterm

24722 pts/0    00:00:00 bash

24761 pts/0    00:00:00 su

24764 pts/0    00:00:00 bash

24824 pts/0    00:00:00 ps

Link to comment
Share on other sites

If you want to flush your swap then turn it off and then on. Here is what I do:

swapoff /dev/hda7

swapon /dev/hda7

This is what I do on my server (64 Meg ram + 128 Meg swap) when I start X for some config and then turn it off.

 

MOttS

Link to comment
Share on other sites

Thanks! There wasn't anything using a substantial amount of memory. That's why I was concerned. The largest was X using 13MB. The other 30 to 40 (keep in mind I'm using kde apps) ranged from 8.0 to 0.0.

 

I thought of the swapoff/ swapon but wasn't sure if that was a good idea. I didn't see a prob with it as long as I had some ram available but just wanted a sec opinion. Thanks....that did it....whatever it was.

 

Any way for someone to crack in and use up mem without root being able to see it?

Link to comment
Share on other sites

  • 1 month later...

:twisted: This is still happening. I read that the new opera7.1 could cause this so I've tried galeon and mozilla and it still occures. If I try any swapoff command I get kicked out of X back to gdm and sometimes rebooted. This was only successful one time without some bad result, like X not really shuting down or something. The main point is that I shouldn't have to be screwing with this. ML9.0 and 8.1 didn't have this prob as stated above it barely even touched my swap, even with kde only about 20-30% would be used after hours of multiple whatever/anything. I've compiled the kernel, taking out most of the unnecessary, and I've done the same with the mm kernel....still happens, with gnome2, kde3.1, and waimea. Nothing in the logs inicate why. I'm at a loss :?

 

I've never known X to use so much memory. Could it be an XFree86-4.3.0 prob?

[bvc@localhost bvc]$ free

            total       used       free     shared    buffers     cached

Mem:        190080     182436       7644          0       3392      40364

-/+ buffers/cache:     138680      51400

Swap:       401584      13492     388092

[bvc@localhost bvc]$ free

            total       used       free     shared    buffers     cached

Mem:        190080     168800      21280          0       2932      40220

-/+ buffers/cache:     125648      64432

Swap:       401584      20640     380944

[bvc@localhost bvc]$ free

            total       used       free     shared    buffers     cached

Mem:        190080     182656       7424          0       2444      23880

-/+ buffers/cache:     156332      33748

Swap:       401584     177524     224060

[bvc@localhost bvc]$ free

            total       used       free     shared    buffers     cached

Mem:        190080     160656      29424          0       4756      39464

-/+ buffers/cache:     116436      73644

Swap:       401584     247596     153988

[bvc@localhost bvc]$ free

            total       used       free     shared    buffers     cached

Mem:        190080     160916      29164          0       4756      39464

-/+ buffers/cache:     116696      73384

Swap:       401584     247328     154256

[bvc@localhost bvc]$ free

            total       used       free     shared    buffers     cached

Mem:        190080     175072      15008          0       4496      38688

-/+ buffers/cache:     131888      58192

Swap:       401584     237324     164260

[bvc@localhost bvc]$ free

            total       used       free     shared    buffers     cached

Mem:        190080     171776      18304          0       4072      43572

-/+ buffers/cache:     124132      65948

Swap:       401584     236092     165492

[bvc@localhost bvc]$

How do you get shared mem? Does everyone show 0?

[bvc@localhost bvc]$ ps auxO-s

USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND

root       886  6.6 47.4 552996 90212 ?      SL   08:42  11:32 /etc/X11/X :0 -deferglyphs 16 -auth /var/lib/gdm/:0.Xauth vt7

bvc       1995 20.3 15.1 48372 28892 ?       S    11:34   0:17 /usr/lib/mozilla-1.3/mozilla-bin

bvc       2025  0.0 15.1 48372 28892 ?       S    11:34   0:00 /usr/lib/mozilla-1.3/mozilla-bin

bvc       2026  0.0 15.1 48372 28892 ?       S    11:34   0:00 /usr/lib/mozilla-1.3/mozilla-bin

bvc       2027  0.0 15.1 48372 28892 ?       S    11:34   0:00 /usr/lib/mozilla-1.3/mozilla-bin

bvc       2028  0.0 15.1 48372 28892 ?       S    11:34   0:00 /usr/lib/mozilla-1.3/mozilla-bin

bvc       2033  0.0 15.1 48372 28892 ?       S    11:35   0:00 /usr/lib/mozilla-1.3/mozilla-bin

bvc       1528  1.1  6.2 24260 11860 ?       S    08:43   1:59 gnome-panel --sm-config-prefix /gnome-panel-D7cmvn/ --sm-client-id 117f000001000105010083700000026910002 --screen 0 

bvc       1677  0.0  2.2 22656 4184 ?        S    09:24   0:04 /usr/bin/gnome-terminal

bvc       1503  0.0  1.7 10780 3404 ?        S    08:43   0:02 /usr/lib/gconfd-2 11

bvc       1529  0.0  0.5 10428 1120 ?        S    08:43   0:00 idesk

xfs        792  0.0  0.3  6632  676 ?        S    08:42   0:00 [xfs]

bvc       1533  0.0  0.9 11844 1836 ?        S    08:43   0:04 /usr/bin/gkrellm

bvc       1538  0.0  0.9 11844 1836 ?        S    08:43   0:00 /usr/bin/gkrellm

bvc       1407  0.0  0.5 16024 1060 ?        S    08:43   0:01 gnome-session

bvc       1509  0.6  2.1 12120 4040 ?        S    08:43   1:09 metacity --sm-save-file 1051997398-3713-1914501147.ms

root       955  0.0  0.1  4956  328 ?        S    08:42   0:00 cupsd

bvc       1505  0.0  0.1  3520  280 ?        S    08:43   0:00 /usr/bin/esd -terminate -nobeeps -as 2 -spawnfd 15

bvc       1513  0.0  0.2 15188  472 ?        S    08:43   0:01 gnome-settings-daemon --oaf-activate-iid=OAFIID:GNOME_SettingsDaemon --oaf-ior-fd=14

bvc       1541  0.0  0.9 14436 1716 ?        S    08:43   0:01 /usr/lib/mixer_applet2 --oaf-activate-iid=OAFIID:GNOME_MixerApplet_Factory --oaf-ior-fd=18

root      1523  0.0  0.1  4552  204 ?        S    08:43   0:00 [wvdial]

bvc       2076  0.0  0.3  2604  744 pts/1    R    11:36   0:00 ps auxO-s

bvc       1543  0.0  0.7 14084 1416 ?        S    08:43   0:00 /usr/lib/notification-area-applet --oaf-activate-iid=OAFIID:GNOME_NotificationAreaApplet_Factory --oaf-ior-fd=20

root       695  0.0  0.0  2188  164 ?        S    08:42   0:00 klogd -2

root       885  0.0  0.0 12924    0 ?        SW   08:42   0:00 [gdm-binary]

bvc       1679  0.0  0.3  2976  700 pts/0    S    09:24   0:00 bash

bvc       2037  9.2  0.9  2972 1900 pts/1    S    11:36   0:00 bash

bvc       1507  0.0  0.6  4388 1268 ?        S    08:43   0:00 /usr/lib/bonobo-activation-server --ac-activate --ior-output-fd=17

root       842  0.0  0.0 11872    0 ?        SW   08:42   0:00 [gdm-binary]

root       135  0.0  0.2  2064  408 ?        S    08:42   0:00 devfsd /dev

bvc       1525  0.0  0.2  4364  504 ?        S    08:43   0:03 xscreensaver -nosplash

bvc       2036  2.5  0.8  3128 1540 ?        S    11:36   0:00 /usr/bin/aterm -T Aterm -bg black -fg DarkGray -sl 6500

root       880  0.0  0.0  1984    4 ?        S    08:42   0:00 xinetd -stayalive -reuse -pidfile /var/run/xinetd.pid

root      1544  0.0  0.0  2024    0 ttyS0    SW   08:44   0:00 [pppd]

bvc       1992  0.0  0.4  2020  920 ?        S    11:34   0:00 /bin/sh /usr/bin/soundwrapper /usr/bin/mozilla

bvc       1519  0.0  0.0  2016    4 ?        S    08:43   0:00 /bin/bash /home/bvc/.xsession

bvc       1520  0.0  0.0  2016    4 ?        S    08:43   0:00 /bin/bash /home/bvc/.xsession

root       687  0.0  0.0  1452  188 ?        S    08:42   0:00 syslogd -m 0

bvc       1773  0.0  0.0  3084    4 ?        S    09:33   0:00 gnome-name-service

rpc        673  0.0  0.0  1508  124 ?        S    08:42   0:00 [portmap]

root      1114  0.0  0.0  1412  120 ?        S    08:42   0:00 crond

root       855  0.0  0.0  1356    4 ?        S    08:42   0:00 /usr/sbin/acpid

root       709  0.0  0.0  1424   60 ?        S    08:42   0:00 gpm -m /dev/usbmouse -t ps/2

bvc       1678  0.0  0.0  1832    0 ?        SW   09:24   0:00 [gnome-pty-helpe]

root         1  0.0  0.0  1356   76 ?        S    08:42   0:04 init [3] 

daemon     834  0.0  0.0  1392  104 ?        S    08:42   0:00 [atd]

root      1215  0.0  0.0  1332    4 vc/1     S    08:42   0:00 /sbin/mingetty tty1

root      1216  0.0  0.0  1332    4 vc/2     S    08:42   0:00 /sbin/mingetty tty2

root      1217  0.0  0.0  1332    4 vc/3     S    08:42   0:00 /sbin/mingetty tty3

root      1218  0.0  0.0  1332    4 vc/4     S    08:42   0:00 /sbin/mingetty tty4

root      1219  0.0  0.0  1332    4 vc/5     S    08:42   0:00 /sbin/mingetty tty5

root      1220  0.0  0.0  1332    4 vc/6     S    08:42   0:00 /sbin/mingetty tty6

root         2  0.0  0.0     0    0 ?        SW   08:42   0:00 [keventd]

root         3  0.0  0.0     0    0 ?        SWN  08:42   0:00 [ksoftirqd_CPU0]

root         4  0.0  0.0     0    0 ?        SW   08:42   0:02 [kswapd]

root         5  0.0  0.0     0    0 ?        SW   08:42   0:00 [bdflush]

root         6  0.0  0.0     0    0 ?        SW   08:42   0:00 [kupdated]

root         9  0.0  0.0     0    0 ?        SW   08:42   0:00 [kreiserfsd]

root       221  0.0  0.0     0    0 ?        SW   08:42   0:00 [khubd]

[bvc@localhost bvc]$

 

how does one use priority with swapon? the man page for swapoff says

-p priority

             Specify priority for swapon.  This option is only  available  if

             swapon  was  compiled  under  and is used under a 1.3.2 or later

             kernel.  priority is a value between 0 and 32767. See  swapon(2)

             for  a full description of swap priorities. Add pri=value to the

             option field of /etc/fstab for use with swapon -a.

but the swapon man says the same thing. uuummm...what is swapon(2)? Would messing with this help?

 

Thanks again :!: :cry:

 

Celeron600 and 192MB RAM

Link to comment
Share on other sites

:twisted:
[bvc@localhost bvc]$ free

            total       used       free     shared    buffers     cached

Mem:        190080     151616      38464          0       5880      61828

-/+ buffers/cache:      83908     106172

Swap:       401584     400660        924

[bvc@localhost bvc]$

Link to comment
Share on other sites

thats scaring :?

 

How do you get shared mem? Does everyone show 0?
Yes, since kernels 2.4 (at least that's what I read long ago).

 

Now I don't have much time, but for sure I'm interested in your problem and I'd like to try to help you.

Link to comment
Share on other sites

I'm back :P but with no help :(

 

I've googled a bit, and tried a few commands (fuser and lsof) to see if I can see which proccesses are using my swap (only 4Mb used) with no results; Conclusion: the ps command is our best friend here.

 

What I see is that the problem is not with the programs allocated into your swap. The problem is with the active ones that are pushing the rest into swap.

 

500000Kb of virtual memory used by X!!!!??? :shock:

Link to comment
Share on other sites

thanks aru for your time! At the time of earlier postings

cat /proc/swaps

showed a priority of -1 and the man page says pri= should be between 0 and 32767. :shock: So I added pri=10 to fstab and things seem a little better if any, and rapidly declining.

[root@localhost proc]# free

            total       used       free     shared    buffers     cached

Mem:        190080     177560      12520          0       2972      34624

-/+ buffers/cache:     139964      50116

Swap:       401584      36348     365236

[root@localhost proc]# free

            total       used       free     shared    buffers     cached

Mem:        190080     182316       7764          0       2696      27836

-/+ buffers/cache:     151784      38296

Swap:       401584     124256     277328

[root@localhost proc]# man swapon

[root@localhost proc]# free

            total       used       free     shared    buffers     cached

Mem:        190080     180584       9496          0       2948      29180

-/+ buffers/cache:     148456      41624

Swap:       401584     176536     225048

[root@localhost proc]#

[bvc@localhost bvc]$ ps auxO-s

USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND

root       873  9.2 46.9 492236 89216 ?      S<L  14:43  14:03 /etc/X11/X -deferglyphs 16 -auth /var/run/xauth/A:0-8s9SLI

bvc       1634  7.6 16.5 58100 31424 ?       S    14:47  11:23 /usr/lib/mozilla-1.3/mozilla-bin

bvc       1664  0.0 16.5 58100 31424 ?       S    14:47   0:00 /usr/lib/mozilla-1.3/mozilla-bin

bvc       1665  0.0 16.5 58100 31424 ?       S    14:47   0:00 /usr/lib/mozilla-1.3/mozilla-bin

bvc       1666  0.0 16.5 58100 31424 ?       S    14:47   0:00 /usr/lib/mozilla-1.3/mozilla-bin

bvc       1668  0.0 16.5 58100 31424 ?       S    14:47   0:04 /usr/lib/mozilla-1.3/mozilla-bin

bvc       1988  0.0 16.5 58100 31424 ?       S    16:41   0:00 /usr/lib/mozilla-1.3/mozilla-bin

bvc       1493  0.9  6.2 24180 11844 ?       S    14:44   1:25 gnome-panel --sm-config-prefix /gnome-panel-D7cmvn/ --sm-client-id 117f000001000105010083700000026910002 --screen 0 

bvc       2149  1.7  6.3 23500 12036 ?       S    17:14   0:02 /usr/bin/gedit

I just haven't had the chance to google for this priority thing....been a liitle busy with...well other things :roll:

Link to comment
Share on other sites

I have that priority too, so I don't know if changing it will fix your problem :?

/# cat /proc/swaps 

Filename                        Type            Size    Used    Priority

/dev/ide/host0/bus0/target1/lun0/part8 partition        248968  4432    -1

 

I'm still thinking that your X consumes too much memory:

/# ps aux | grep "[X] "

root      2434  3.3  2.8 41952 7392 ?        S    May04   6:59 /etc/X11/X :0 -dp

 

From my slackware:

[root@paleo: ~]# cat /proc/swaps 

Filename                        Type            Size    Used    Priority

/dev/hda2                       partition       229816  0       -1

[root@paleo: ~]# ps aux | grep "[X] "

root       157  1.3  6.9 23548 17808 ?       S    01:27   1:00 X :0

 

A priority of -1 means that swap is non-prioritized whatever that means, so is a right value (priority makes sense IMHO when there are more than one swap device or file)

 

[edited] Added slackware's swaps output

Link to comment
Share on other sites

Now I'm worried. My X uses 306,000:

[root@localhost omar]# ps auxO-s 

USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND

root      2548  9.5  9.0 306760 34784 ?      SL   May02 361:00 /etc/X11/X :0 -deferglyphs 16

Link to comment
Share on other sites

I lowered my res (everything is so big :shock: ), took out some NVIDIA options that make things a little better, changed themes to be quite basic and a not so intense wallpaper, and though it takes longer to get there it's still

root      1356  2.9 51.3 403856 97628 ?      SL   21:11   4:22 [X]

[bvc@localhost bvc]$ ps auxO-s

USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND

root      1356  2.9 50.3 404472 95728 ?      RL   21:11   4:23 [X]

 

I've searched and serached with google......this sucks :twisted: BTW....I don't have this prob in Slackware 9.0 which also has XFree86-4.3 and kernel-2.4.21.

 

Oh, and also tried gdm, kdm, mdkkdm, Xtart, and startx.

Link to comment
Share on other sites

Do you think this is an X and NVIDIA driver problem? In my desktop, I see X using 167,652. It is using X-Free 4.3 and NVidia driver (looking at lsmod, I see that NVidia driver takes 1678784 of whatever it is). In my server with similar desktop configuration (kde 3.1, gkrellm on every desktop, same resolution and all), it takes much less memory footprint. The only difference between my desktop and server video wise is that my server uses SIS 730S built in video ( I have to allocate 16 meg from main memory for video). Yeah, everything seems to load and redraw slower in my server but X doesn't take that much memory footprint in there.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...