You are not logged in.

#1 2012-02-24 04:34:08

Bhaskar
Member
Registered: 2012-02-24
Posts: 8

[SOLVED]Swap issues

Hello everyone,
Please excuse me if it is an old issue.

I have Arch with Xfce4 running in my Dell XPS M1330.

Recently I re-installed.

My swap is not being used.

Output of blkid :

/dev/sda1: UUID="7b793108-78c9-4b34-85dd-56b6ffd9be3d" TYPE="ext2"
/dev/sda2: UUID="b24eed03-5b20-4db0-a304-ca1a012a4bdf" TYPE="swap"
/dev/sda3: UUID="08d25a35-7c94-401f-8693-f9f04cf33dda" TYPE="ext4"
/dev/sda4: UUID="75767789-e11c-4bfb-9f66-3fe602daa9e0" TYPE="ext4"

fstab entry :

# /etc/fstab: static file system information
#
# <file system>    <dir>    <type>    <options>    <dump>    <pass>
tmpfs        /tmp    tmpfs    nodev,nosuid    0    0
UUID=08d25a35-7c94-401f-8693-f9f04cf33dda / ext4 defaults 0 1
UUID=b24eed03-5b20-4db0-a304-ca1a012a4bdf swap swap defaults 0 0
#/dev/sda2 swap swap defaults 0 0
UUID=75767789-e11c-4bfb-9f66-3fe602daa9e0 /home ext4 defaults 0 1
UUID=7b793108-78c9-4b34-85dd-56b6ffd9be3d /boot ext2 defaults 0 1
#/dev/sdb1 /mnt/usb auto user,noauto,noatime,flush 0 0

I tried remaking the swap using mkswap and tried with swapon -a with no difference.

If anyone can help..I would much appreciate.

Best,
  Bhaskar.

Last edited by Bhaskar (2012-02-24 10:02:17)

Offline

#2 2012-02-24 06:25:23

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: [SOLVED]Swap issues

What do you mean exactly with "My swap is not being used"?

When you for example run "free -m", your swap isn't listed there or...?


Burninate!

Offline

#3 2012-02-24 06:46:21

Bhaskar
Member
Registered: 2012-02-24
Posts: 8

Re: [SOLVED]Swap issues

free -m output


                               total       used       free     shared    buffers     cached
Mem:                      2007       1582        424          0         33        298
-/+ buffers/cache:   1250        756
Swap:                      4102          0       4102

I have tried all possible solutions I could find googling..why I had to ask here smile
Something is not right, but cannot put finger on it.

Thanks for replying.

Any queries, I would be glad to answer regarding the problem.

Offline

#4 2012-02-24 07:17:04

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [SOLVED]Swap issues

It says you have 4 GB of swap. "swapon -s" should confirm. It will get used when it's needed (you can modify swappiness to make it more or less likely to swap).

Offline

#5 2012-02-24 07:22:09

Bhaskar
Member
Registered: 2012-02-24
Posts: 8

Re: [SOLVED]Swap issues

output of swapon -s :

Filename                Type        Size    Used    Priority
/dev/sda2                               partition    4200992    0    -1

it shows the swap but it is not used.


free -m
             total       used       free     shared    buffers     cached
Mem:          2007       1662        344          0         36        301
-/+ buffers/cache:       1323        683
Swap:         4102          0       4102

I work with media rich content..so after 2 hrs or so, my memory is full...the system is painfully slow, the cpu even gets overloaded...still no use of swap...please help if you can.

Thank you.

Offline

#6 2012-02-24 07:30:55

wideeye
Member
Registered: 2006-09-30
Posts: 32

Re: [SOLVED]Swap issues

you can play with the swappiness setting to adjust how often it is used.

https://wiki.archlinux.org/index.php/Swap#Swappiness

Offline

#7 2012-02-24 07:34:24

Bhaskar
Member
Registered: 2012-02-24
Posts: 8

Re: [SOLVED]Swap issues

Yes, I saw that wiki entry. But as I am not using the swap at all, the control does not help using sysctl.
Thank you.

Offline

#8 2012-02-24 08:18:22

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [SOLVED]Swap issues

What does "cat /proc/sys/vm/swappiness" return?

The following script should make your system swap heavily (might make your system unresponsive for some time):

#!/usr/bin/perl -w

my @blobs;
my $count = 0;
my $total = 0;

while (1) {
 ++$count;
 push(@blobs, ('.' x (1048576 * $count)));
 $total += $count;
 print STDERR "${total}M allocated\n";
 }

Offline

#9 2012-02-24 08:41:01

Bhaskar
Member
Registered: 2012-02-24
Posts: 8

Re: [SOLVED]Swap issues

Hello again,
I just want the swap to start working normal way. Swapiness is at 60, the default value of the system. I just do not know why it is not working at all!

cat /proc/sys/vm/swappiness
60

Regards.

Offline

#10 2012-02-24 09:03:04

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [SOLVED]Swap issues

I have no idea why it wouldn't use swap. You could see what the result of running the script is.

Offline

#11 2012-02-24 09:21:48

Bhaskar
Member
Registered: 2012-02-24
Posts: 8

Re: [SOLVED]Swap issues

Running the script actually start using swap space.

free -m
             total       used       free     shared    buffers     cached
Mem:          2007       1132        875          0          0        110
-/+ buffers/cache:       1021        985
Swap:         4102        500       3602

I stopped the script as it was making my system almost hang!
Still the swap is used and free showing change of values.

No idea, what actually happened!

I shall now reboot to see the effect!

Will post after...not marking [SOLVED], the thread yet.

Regards.

Offline

#12 2012-02-24 09:33:06

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [SOLVED]Swap issues

You normally have to give it some time (hours of uptime) or provide a decent memory pressure (like the script did) for it to start swapping. You could show us the output of "free -m" and "top -b -n1" when you feel your system is starting to work slowly.

Offline

#13 2012-02-24 09:45:33

Bhaskar
Member
Registered: 2012-02-24
Posts: 8

Re: [SOLVED]Swap issues

./script.pl
1M allocated
3M allocated
6M allocated
10M allocated
15M allocated
21M allocated
28M allocated
36M allocated
45M allocated
55M allocated
66M allocated
78M allocated
91M allocated
105M allocated
120M allocated
136M allocated
153M allocated
171M allocated
190M allocated
210M allocated
231M allocated
253M allocated
276M allocated
300M allocated
325M allocated
351M allocated
378M allocated
406M allocated
435M allocated
465M allocated
496M allocated
528M allocated
561M allocated
595M allocated
630M allocated
666M allocated
703M allocated
741M allocated
780M allocated
820M allocated
861M allocated
903M allocated
946M allocated
990M allocated
1035M allocated
1081M allocated
1128M allocated
1176M allocated
1225M allocated
1275M allocated
1326M allocated
1378M allocated
1431M allocated
1485M allocated
Out of memory!

After reboot no swap use with this script or is it alright this way?

Offline

#14 2012-02-24 09:48:56

Damnshock
Member
From: Barcelona
Registered: 2006-09-13
Posts: 414

Re: [SOLVED]Swap issues

There's nothing wrong with your swap. It will be used when needed, not a second before.

Regards


My blog: blog.marcdeop.com
Jabber ID: damnshock@jabber.org

Offline

#15 2012-02-24 09:56:20

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [SOLVED]Swap issues

It's normal the script wouldn't cause swapping out of other processes fresh after reboot. Using "code" tags for longer pasted output is advisable.

Last edited by lucke (2012-02-24 09:57:29)

Offline

#16 2012-02-24 10:01:10

Bhaskar
Member
Registered: 2012-02-24
Posts: 8

Re: [SOLVED]Swap issues

Hello lucke,
I think you are right. I checked the script and it is indeed working the way it should.
Thank you very much for your feed back!
I am testing some jre based online game interface to be particular as my job.
After an hour of use the system gets slow.
I thought it was the swap, as it was not showing any use at all, while the memory was almost full!

Now looking back and re-checking I think it might be the "cpu" as well. The cpu use is full (around 100%), when it gets slow, I did not pay attention to CPU use as I thought it will self adjust.

I am just putting cat /proc/cpuinfo output here for you, and will take "free" and "top" shots when it happens again.

cat /proc/cpuinfo

processor    : 0
vendor_id    : GenuineIntel
cpu family    : 6
model        : 15
model name    : Intel(R) Core(TM)2 Duo CPU     T7250  @ 2.00GHz
stepping    : 13
microcode    : 0xa3
cpu MHz        : 1995.057
cache size    : 2048 KB
physical id    : 0
siblings    : 2
core id        : 0
cpu cores    : 2
apicid        : 0
initial apicid    : 0
fdiv_bug    : no
hlt_bug        : no
f00f_bug    : no
coma_bug    : no
fpu        : yes
fpu_exception    : yes
cpuid level    : 10
wp        : yes
flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm lahf_lm ida dts tpr_shadow vnmi flexpriority
bogomips    : 3991.36
clflush size    : 64
cache_alignment    : 64
address sizes    : 36 bits physical, 48 bits virtual
power management:

processor    : 1
vendor_id    : GenuineIntel
cpu family    : 6
model        : 15
model name    : Intel(R) Core(TM)2 Duo CPU     T7250  @ 2.00GHz
stepping    : 13
microcode    : 0xa3
cpu MHz        : 1995.057
cache size    : 2048 KB
physical id    : 0
siblings    : 2
core id        : 1
cpu cores    : 2
apicid        : 1
initial apicid    : 1
fdiv_bug    : no
hlt_bug        : no
f00f_bug    : no
coma_bug    : no
fpu        : yes
fpu_exception    : yes
cpuid level    : 10
wp        : yes
flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm lahf_lm ida dts tpr_shadow vnmi flexpriority
bogomips    : 3991.24
clflush size    : 64
cache_alignment    : 64
address sizes    : 36 bits physical, 48 bits virtual
power management:


I thank you very much for all your help again and I am putting this thread as solved as if my problem is cpu based I shall just post a note to inform.

Swap is fine and working anyways...well in special situations at least! tongue

Regards.

Offline

Board footer

Powered by FluxBB