FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 10-26-2010, 06:16 AM
Adam Carter
 
Default swap usage creeping up

nothing unusual there, except for the swap usage itself. *'top' doesn't

show any large apps. *sorted by mem the top 4 are:

*PID USER * * *PR *NI *VIRT *RES *SHR S %CPU %MEM * *TIME+ *COMMAND

*8318 iain * * *20 * 0 *494m 150m *21m S * *0 *5.0 * 1:20.67 evolution

20424 iain * * *20 * 0 *342m *77m *30m S * *0 *2.5 * 0:01.84 firefox

*8009 root * * *20 * 0 83364 *37m 6260 S * *7 *1.2 *38:34.31 X

*8090 iain * * *20 * 0 *159m *32m 1600 S * *1 *1.1 * 3:48.08 skype



Hm, I just noticed Mem is in %. *% of what? *% total or % used? *Even if

it was % of total RAM that could be as much as 152Mb for evo and 76Mb

for firefox. *Not that much really.

Divide VIRT by its percentage, then divide RES by its percentage, when the numbers match you know which one it is.

So it looks like its RES to me by just looking at it. Did you RTFMan page?
 
Old 10-26-2010, 06:30 AM
Fatih Tümen
 
Default swap usage creeping up

On Tue, Oct 26, 2010 at 8:49 AM, Iain Buchanan <iaindb@netspace.net.au> wrote:
> Hi,
>
> over the last week or so I've noticed unusually large swap usage. *I
> usually hibernate this laptop and have uptimes up to 12 days so apps can
> run for a long time. *I don't usually use any swap space (except for a
> few k).
>
> If I swapoff and swapon, the usage falls back to zero but then creeps up
> again over a few days.
>
> $ free -m
> * * * * * * total * * * used * * * free * * shared * *buffers * * cached
> Mem: * * * * *3040 * * * *859 * * * 2181 * * * * *0 * * * * 38 * * * *415
> -/+ buffers/cache: * * * *406 * * * 2634
> Swap: * * * * *494 * * * *431 * * * * 62
>

Looking at above values 494MB does not seem to be enough for
hibernation. Do you add extra swap or close some apps before
hibernation?

If your system trying to fill up your swap while you have more than
2GB of main memory available, only thing I can think of is your
swapiness is set very high. You check and alter is as follows

$ cat /proc/sys/vm/swappiness
and
# echo N > /proc/sys/vm/swappiness

where N is a value between 0 and 100. Higher number means more
swapping. If I had 3GB of ram I would set it to something closer to 0
or even 0 if I am just gonna use it for hibernation.

> nothing unusual there, except for the swap usage itself. *'top' doesn't
> show any large apps. *sorted by mem the top 4 are:
> *PID USER * * *PR *NI *VIRT *RES *SHR S %CPU %MEM * *TIME+ *COMMAND
> *8318 iain * * *20 * 0 *494m 150m *21m S * *0 *5.0 * 1:20.67 evolution
> 20424 iain * * *20 * 0 *342m *77m *30m S * *0 *2.5 * 0:01.84 firefox
> *8009 root * * *20 * 0 83364 *37m 6260 S * *7 *1.2 *38:34.31 X
> *8090 iain * * *20 * 0 *159m *32m 1600 S * *1 *1.1 * 3:48.08 skype
>
> Hm, I just noticed Mem is in %. *% of what? *% total or % used? *Even if
> it was % of total RAM that could be as much as 152Mb for evo and 76Mb
> for firefox. *Not that much really.
>

% of total main memory excluding swap because its rather difficult to
take it into account.
3040*0.05 = 152 evolution


> any ideas?
>

You can try to view swap usage on top by pressing f then p and enter
and sort by it by F then P and enter. The values wont be very
realistic though. Alternatively you could try is to compare resident
memory usages before and after swapoff.

Given the mem usage of your apps, total mem usage looks normal. What
does not seem normal is that swap inclined mem usage. Seriously take a
look at your swapiness value. The default value cannot be right every
particular case.


> thanks
> --
> Iain Buchanan <iaindb at netspace dot net dot au>
>
> Chuck Norris once skewered a man with the Eiffel tower.
>
>
>


--
* *Fatih
 
Old 10-26-2010, 06:57 AM
Iain Buchanan
 
Default swap usage creeping up

On Tue, 2010-10-26 at 17:16 +1100, Adam Carter wrote:
>
> So it looks like its RES to me by just looking at it. Did you RTFMan
> page?

for top? no. I should add I wasn't sorting by the RES field, even
though that's in the top listing.
--
Iain Buchanan <iaindb at netspace dot net dot au>

Snake: Adios-s-s, dos amigos-s-s!
 
Old 10-26-2010, 07:02 AM
Iain Buchanan
 
Default swap usage creeping up

Hi,

On Tue, 2010-10-26 at 09:30 +0300, Fatih Tümen wrote:

> Looking at above values 494MB does not seem to be enough for
> hibernation. Do you add extra swap or close some apps before
> hibernation?

Tuxonice filewriter

$ ls -alh /suspend_file
-rw------- 1 root root 1001M May 17 12:02 /suspend_file

> If your system trying to fill up your swap while you have more than
> 2GB of main memory available, only thing I can think of is your
> swapiness is set very high. You check and alter is as follows

has it changed in recent kernels? I'm looking for the reason for the
change in behaviour... useful though, thanks

> Seriously take a
> look at your swapiness value. The default value cannot be right every
> particular case.

it's 60. That seems a little high based on what you told me, but I have
no reference value to compare it to from 2-3 weeks ago.

I'll set it lower and watch...

thanks,
--
Iain Buchanan <iaindb at netspace dot net dot au>

Calculon: I was all of history's great acting robots: Acting Unit 0.8,
Thespo-mat, David Duchovny!
 
Old 10-26-2010, 07:10 AM
Dale
 
Default swap usage creeping up

Iain Buchanan wrote:

Hi,

over the last week or so I've noticed unusually large swap usage. I
usually hibernate this laptop and have uptimes up to 12 days so apps can
run for a long time. I don't usually use any swap space (except for a
few k).

If I swapoff and swapon, the usage falls back to zero but then creeps up
again over a few days.

$ free -m
total used free shared buffers cached
Mem: 3040 859 2181 0 38 415
-/+ buffers/cache: 406 2634
Swap: 494 431 62

nothing unusual there, except for the swap usage itself. 'top' doesn't
show any large apps. sorted by mem the top 4 are:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
8318 iain 20 0 494m 150m 21m S 0 5.0 1:20.67 evolution
20424 iain 20 0 342m 77m 30m S 0 2.5 0:01.84 firefox
8009 root 20 0 83364 37m 6260 S 7 1.2 38:34.31 X
8090 iain 20 0 159m 32m 1600 S 1 1.1 3:48.08 skype

Hm, I just noticed Mem is in %. % of what? % total or % used? Even if
it was % of total RAM that could be as much as 152Mb for evo and 76Mb
for firefox. Not that much really.

any ideas?

thanks




I ran into this a while back and noticed that a setting got changed and
I didn't know about it. Still no idea what changed it but you can
check the setting with this:


root@smoker / # cat /proc/sys/vm/swappiness
20
root@smoker / #

The lower the number, the less often it will use swap. I have swap on
some slow drives and 2Gbs of ram so I don't want swap used unless it
will keep me from crashing. You can use echo to change the setting and
I actually added this to rc.conf to set it at bootup:


echo 20 > /proc/sys/vm/swappiness

May not be the problem but worth checking into at least.

Dale

:-) :-)
 
Old 10-26-2010, 07:18 AM
Fatih Tümen
 
Default swap usage creeping up

On Tue, Oct 26, 2010 at 10:02 AM, Iain Buchanan <iaindb@netspace.net.au> wrote:
> On Tue, 2010-10-26 at 09:30 +0300, Fatih Tümen wrote:
>
>> Looking at above values 494MB does not seem to be enough for
>> hibernation. Do you add extra swap or close some apps before
>> hibernation?
>
> Tuxonice filewriter
>
> $ ls -alh /suspend_file
> -rw------- 1 root root 1001M May 17 12:02 /suspend_file

Ah, hadn't thought of that, thanks.

--
* *Fatih
 
Old 10-27-2010, 10:47 PM
Iain Buchanan
 
Default swap usage creeping up

On Tue, 2010-10-26 at 16:32 +0930, Iain Buchanan wrote:

> > Seriously take a
> > look at your swapiness value. The default value cannot be right every
> > particular case.
>
> it's 60. That seems a little high based on what you told me, but I have
> no reference value to compare it to from 2-3 weeks ago.

well, in the last few days I haven't seen any swap usage at all, which
is how the system used to run!

Strange how the swappiness changed so dramatically in recent kernels.

thanks,
--
Iain Buchanan <iaindb at netspace dot net dot au>

I can't die until the government finds a safe place to bury my liver.
-- Phil Harris
 
Old 10-27-2010, 11:44 PM
Neil Bothwick
 
Default swap usage creeping up

On Thu, 28 Oct 2010 08:17:30 +0930, Iain Buchanan wrote:

> > it's 60. That seems a little high based on what you told me, but I
> > have no reference value to compare it to from 2-3 weeks ago.
>
> well, in the last few days I haven't seen any swap usage at all, which
> is how the system used to run!
>
> Strange how the swappiness changed so dramatically in recent kernels.

I wondered the same when I checked and saw that my computers were using
60 too. But when I googled about it I found references to a default of 60
from over a year ago.


--
Neil Bothwick

Despite the cost of living it remains popular.
 
Old 10-27-2010, 11:59 PM
Dale
 
Default swap usage creeping up

Neil Bothwick wrote:

On Thu, 28 Oct 2010 08:17:30 +0930, Iain Buchanan wrote:



it's 60. That seems a little high based on what you told me, but I
have no reference value to compare it to from 2-3 weeks ago.


well, in the last few days I haven't seen any swap usage at all, which
is how the system used to run!

Strange how the swappiness changed so dramatically in recent kernels.


I wondered the same when I checked and saw that my computers were using
60 too. But when I googled about it I found references to a default of 60
from over a year ago.




That was about the time mine got changed. I always wondered how that
got changed. Since I added it to rc.conf, that should keep it from
getting changed again. May want to do the same on yours too.


Dale

:-) :-)
 
Old 10-28-2010, 01:12 AM
Adam Carter
 
Default swap usage creeping up

On Thu, Oct 28, 2010 at 10:59 AM, Dale <rdalek1967@gmail.com> wrote:



That was about the time mine got changed. *I always wondered how that got changed. *Since I added it to rc.conf, that should keep it from getting changed again. *May want to do the same on yours too.



Usually you put stuff like that in /etc/sysctl.conf. IIRC the key is vm.swappiness.
 

Thread Tools




All times are GMT. The time now is 09:51 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org