* top lies ?
@ 2007-11-12 17:57 Tomasz Kłoczko
2007-11-12 22:28 ` Jarek Poplawski
2007-11-13 0:14 ` Andreas Schwab
0 siblings, 2 replies; 7+ messages in thread
From: Tomasz Kłoczko @ 2007-11-12 17:57 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1: Type: TEXT/PLAIN, Size: 906 bytes --]
Some data showed by top command looks like completly trashed.
Fragment from top output:
Mem: 2075784k total, 2053352k used, 22432k free, 19260k buffers
Swap: 2096472k total, 136k used, 2096336k free, 1335080k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ SWAP nFLT WCHAN COMMAND
14515 mysql 20 0 1837m 563m 4132 S 39 27.8 27:14.20 1.2g 18 - mysqld
How it is possible that swap ussage is 136k and swapped out portion of (in
this case) mysqld process is 1.2g ?
Mayby some other data from /proc/<pid> shows some *real* data ?
Above is on procps 3.2.7 and kernel 2.6.22.12.
kloczek
--
-----------------------------------------------------------
*Ludzie nie mają problemów, tylko sobie sami je stwarzają*
-----------------------------------------------------------
Tomasz Kłoczko, sys adm @zie.pg.gda.pl|*e-mail: kloczek@rudy.mif.pg.gda.pl*
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: top lies ?
2007-11-12 17:57 top lies ? Tomasz Kłoczko
@ 2007-11-12 22:28 ` Jarek Poplawski
2007-11-13 0:14 ` Andreas Schwab
1 sibling, 0 replies; 7+ messages in thread
From: Jarek Poplawski @ 2007-11-12 22:28 UTC (permalink / raw)
To: Tomasz Kłoczko; +Cc: linux-kernel
Tomasz Kłoczko wrote, On 11/12/2007 06:57 PM:
> Some data showed by top command looks like completly trashed.
> Fragment from top output:
>
> Mem: 2075784k total, 2053352k used, 22432k free, 19260k buffers
> Swap: 2096472k total, 136k used, 2096336k free, 1335080k cached
>
> PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ SWAP nFLT WCHAN COMMAND
> 14515 mysql 20 0 1837m 563m 4132 S 39 27.8 27:14.20 1.2g 18 - mysqld
>
> How it is possible that swap ussage is 136k and swapped out portion of (in
> this case) mysqld process is 1.2g ?
It seems this bigger SWAP is virtual (not necessarily used yet), something
similar like here:
>From man ps:
"size SZ approximate amount of swap space that would be required if the process were to dirty
all writable pages and then be swapped out. This number is very rough!"
Regards,
Jarek P.
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: top lies ?
2007-11-12 17:57 top lies ? Tomasz Kłoczko
2007-11-12 22:28 ` Jarek Poplawski
@ 2007-11-13 0:14 ` Andreas Schwab
2007-11-13 2:23 ` Tomasz Kłoczko
1 sibling, 1 reply; 7+ messages in thread
From: Andreas Schwab @ 2007-11-13 0:14 UTC (permalink / raw)
To: Tomasz Kłoczko; +Cc: linux-kernel
Tomasz Kłoczko <kloczek@rudy.mif.pg.gda.pl> writes:
> Some data showed by top command looks like completly trashed.
> Fragment from top output:
>
> Mem: 2075784k total, 2053352k used, 22432k free, 19260k buffers
> Swap: 2096472k total, 136k used, 2096336k free, 1335080k cached
>
> PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ SWAP nFLT WCHAN COMMAND
> 14515 mysql 20 0 1837m 563m 4132 S 39 27.8 27:14.20 1.2g 18 - mysqld
>
> How it is possible that swap ussage is 136k and swapped out portion of (in
> this case) mysqld process is 1.2g ?
SWAP is just VIRT - RES. It means that 1.2g of the allocated virtual
address space is not resident, but it does not mean that all of it is
written to the swap space, it can also be part of a file based mapping.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: top lies ?
2007-11-13 0:14 ` Andreas Schwab
@ 2007-11-13 2:23 ` Tomasz Kłoczko
0 siblings, 0 replies; 7+ messages in thread
From: Tomasz Kłoczko @ 2007-11-13 2:23 UTC (permalink / raw)
To: Andreas Schwab; +Cc: linux-kernel
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1232 bytes --]
On Tue, 13 Nov 2007, Andreas Schwab wrote:
> Tomasz Kłoczko <kloczek@rudy.mif.pg.gda.pl> writes:
>
>> Some data showed by top command looks like completly trashed.
>> Fragment from top output:
>>
>> Mem: 2075784k total, 2053352k used, 22432k free, 19260k buffers
>> Swap: 2096472k total, 136k used, 2096336k free, 1335080k cached
>>
>> PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ SWAP nFLT WCHAN COMMAND
>> 14515 mysql 20 0 1837m 563m 4132 S 39 27.8 27:14.20 1.2g 18 - mysqld
>>
>> How it is possible that swap ussage is 136k and swapped out portion of (in
>> this case) mysqld process is 1.2g ?
>
> SWAP is just VIRT - RES. It means that 1.2g of the allocated virtual
> address space is not resident, but it does not mean that all of it is
> written to the swap space, it can also be part of a file based mapping.
OK but where I can find per process data about number of
pages/amout of memory in swap ?
kloczek
--
-----------------------------------------------------------
*Ludzie nie mają problemów, tylko sobie sami je stwarzają*
-----------------------------------------------------------
Tomasz Kłoczko, sys adm @zie.pg.gda.pl|*e-mail: kloczek@rudy.mif.pg.gda.pl*
^ permalink raw reply [flat|nested] 7+ messages in thread
* top lies ?
@ 2007-11-13 7:08 Al Boldi
2007-11-13 7:19 ` Balbir Singh
0 siblings, 1 reply; 7+ messages in thread
From: Al Boldi @ 2007-11-13 7:08 UTC (permalink / raw)
To: linux-kernel
kloczek wrote:
> Some data showed by top command looks like completly trashed.
> Fragment from top output:
>
> Mem: 2075784k total, 2053352k used, 22432k free, 19260k buffers
> Swap: 2096472k total, 136k used, 2096336k free, 1335080k cached
>
> PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ SWAP nFLT
> WCHAN COMMAND 14515 mysql 20 0 1837m 563m 4132 S 39 27.8
> 27:14.20 1.2g 18 - mysqld
>
> How it is possible that swap ussage is 136k and swapped out portion of (in
> this case) mysqld process is 1.2g ?
Welcome to OverCommit, aka OOM-nirvana.
Try this:
# echo 2 > /proc/sys/vm/overcommit_memory
# echo 0 > /proc/sys/vm/overcommit_ratio
But make sure you have enough swap.
Thanks!
--
Al
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: top lies ?
2007-11-13 7:08 Al Boldi
@ 2007-11-13 7:19 ` Balbir Singh
2007-11-13 7:38 ` Al Boldi
0 siblings, 1 reply; 7+ messages in thread
From: Balbir Singh @ 2007-11-13 7:19 UTC (permalink / raw)
To: Al Boldi; +Cc: linux-kernel
On Nov 13, 2007 12:38 PM, Al Boldi <a1426z@gawab.com> wrote:
> kloczek wrote:
> > Some data showed by top command looks like completly trashed.
> > Fragment from top output:
> >
> > Mem: 2075784k total, 2053352k used, 22432k free, 19260k buffers
> > Swap: 2096472k total, 136k used, 2096336k free, 1335080k cached
> >
> > PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ SWAP nFLT
> > WCHAN COMMAND 14515 mysql 20 0 1837m 563m 4132 S 39 27.8
> > 27:14.20 1.2g 18 - mysqld
> >
> > How it is possible that swap ussage is 136k and swapped out portion of (in
> > this case) mysqld process is 1.2g ?
>
> Welcome to OverCommit, aka OOM-nirvana.
>
> Try this:
> # echo 2 > /proc/sys/vm/overcommit_memory
> # echo 0 > /proc/sys/vm/overcommit_ratio
>
> But make sure you have enough swap.
>
>
> Thanks!
The swap cache looks pretty big, may be top is including that data
while reporting swap usage.
Balbir
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: top lies ?
2007-11-13 7:19 ` Balbir Singh
@ 2007-11-13 7:38 ` Al Boldi
0 siblings, 0 replies; 7+ messages in thread
From: Al Boldi @ 2007-11-13 7:38 UTC (permalink / raw)
To: Balbir Singh; +Cc: linux-kernel
Balbir Singh wrote:
> On Nov 13, 2007 12:38 PM, Al Boldi <a1426z@gawab.com> wrote:
> > kloczek wrote:
> > > Some data showed by top command looks like completly trashed.
> > > Fragment from top output:
> > >
> > > Mem: 2075784k total, 2053352k used, 22432k free, 19260k
> > > buffers Swap: 2096472k total, 136k used, 2096336k free,
> > > 1335080k cached
> > >
> > > PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ SWAP nFLT WCHAN COMMAND
> > > 14515 mysql 20 0 1837m 563m 4132 S 39 27.8 27:14.20 1.2g 18 - mysqld
> > >
> > > How it is possible that swap ussage is 136k and swapped out portion of
> > > (in this case) mysqld process is 1.2g ?
> >
> > Welcome to OverCommit, aka OOM-nirvana.
> >
> > Try this:
> > # echo 2 > /proc/sys/vm/overcommit_memory
> > # echo 0 > /proc/sys/vm/overcommit_ratio
> >
> > But make sure you have enough swap.
> >
> >
> > Thanks!
>
> The swap cache looks pretty big, may be top is including that data
> while reporting swap usage.
I don't think so. top reports correctly, it's the VM that is lying.
I guess you can tell what happens when push comes to shove...
Thanks!
--
Al
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-11-13 7:42 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-12 17:57 top lies ? Tomasz Kłoczko
2007-11-12 22:28 ` Jarek Poplawski
2007-11-13 0:14 ` Andreas Schwab
2007-11-13 2:23 ` Tomasz Kłoczko
-- strict thread matches above, loose matches on Subject: below --
2007-11-13 7:08 Al Boldi
2007-11-13 7:19 ` Balbir Singh
2007-11-13 7:38 ` Al Boldi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox