swap -d failure

Hi All

I needed to add swap space temporarily to a server so I could run an oracle installer..

So I did swap -a 100M /data01/swapfile.zak

Still had an issue

So I did swap -a 5000M /data01/swapfile.zak1

Once I had finished

I did swap -d /data01/swapfile.zak

No problems... I deleted the file...

However when I do: swap -d /data01/swapfile.zak1

I get

swapfile.zak1: Not enough space

Can just delete the file?

How can free up the swap space?

Thanking you all inadvance..

Z

What platform are you on and post the swap utilization on your machine. You might be having severe memory shortage.

Apologies, should have included that orginally ...

SunOS 9

snapshot of top

last pid: 9333; load averages: 0.09, 0.12, 0.10 17:06:14
65 processes: 64 sleeping, 1 on cpu
CPU states: 70.0% idle, 0.0% user, 2.0% kernel, 28.0% iowait, 0.0% swap
Memory: 2048M real, 77M free, 3768M swap in use, 4781M swap free

root@adclick-winn:~ 0 # swap -l
swapfile dev swaplo blocks free
/dev/md/dsk/d20 85,20 16 4202672 358704
/data01/swapfile.zak1 - 16 10239984 9328864
root@adclick-winn:~ 0 #

root@adclick-winn:~ 0 # swap -s
total: 3810936k bytes allocated + 46864k reserved = 3857800k used, 4895960k available
root@adclick-winn:~ 0 #

Is this a workstation or a server type machine? Out of 2G of physical memory only 77M is free which points to memory shortage.
What is the maximum amount of physical memory that can be installed in your machine?
Post the output of vmstat on your machine...look for signs of heavy paging activity in its output.

its a v240 server.

root@adclick-winn:~ 0 # vmstat 5 5
kthr memory page disk faults cpu
r b w swap free re mf pi po fr de sr m1 m1 m1 m2 in sy cs us sy id
0 0 20 1069504 249480 143 51 1238 77 78 0 2 0 0 0 0 30 79 117 10 3 87
0 0 27 4892384 121960 101 7 9795 85 85 0 0 0 0 0 0 1089 1100 1220 1 4 96
0 1 27 4892384 118032 85 6 11032 97 97 0 0 0 0 0 0 1142 1190 1247 1 3 96
0 0 27 4892384 114912 46 6 9871 96 96 0 0 0 0 0 0 1027 1177 1232 1 3 95
0 0 27 4892384 113848 9 6 13343 113 113 0 0 0 0 0 0 1153 1230 1250 1 2 97

root@adclick-winn:/usr/platform/SUNW,Sun-Fire-V240/sbin 0 # ./prtdiag |more
System Configuration: Sun Microsystems sun4u Sun Fire V240
System clock frequency: 167 MHZ
Memory size: 2GB

==================================== CPUs ====================================
E$ CPU CPU Temperature
CPU Freq Size Implementation Mask Die Amb. Status Location
--- -------- ---------- --------------------- ----- ---- ---- ------ --------
0 1503 MHz 1MB SUNW,UltraSPARC-IIIi 3.4 - - online MB/P0
1 1503 MHz 1MB SUNW,UltraSPARC-IIIi 3.4 - - online MB/P1

vmstat output shows high paging activity pointing to memory shortage.
Don't know much about Sun servers but what is the max amount of memory that can be added to this machine?
Double the physical memory to 4G...should reduce the paging activity and then try deallocating the swap space.
Any applications running on this machine experiencing slowness?

Tragically the oracle database... not sure what to do... I guess I could shut all the apps and database down and try it again???

Better to shutdown all apps and Oracle; add more memory to the machine; and then bring up the box. Otherwise if you just want to recycle the apps and Oracle...shutdown everything and bring up Oracle and a subset of the apps (only the ones that are absolutely needed) and see if that fixes your performance issue.

Zak,
Yes. I feel shutting down application which is eating most of the memory free up some memory to delete swap space. Rather than shutting down box, its better option.

  • nilesh