Clarification needed reg Linux behaviour of Swap space and Swap

Clarification needed reg Linux behaviour of Swap space and Swap

am 15.05.2010 16:52:23 von Query

Hi ,

We are seeing high memory usage on our Prod host running RHEL 4. The
host is running Java server
and the application server is consuming around 2.2 G of memory as
reported by top .

===
Tasks: 449 total, 1 running, 448 sleeping, 0 stopped, 0 zombie
Cpu(s): 12.9% us, 0.1% sy, 0.0% ni, 87.0% id, 0.0% wa, 0.0% hi,
0.0% si
Mem: 8160920k total, 8088752k used, 72168k free, 75516k
buffers
Swap: 8388600k total, 3651908k used, 4736692k free, 807556k
cached

PID USER PR NI %CPU TIME+ %MEM VIRT RES SHR S
COMMAND
31712 nobody 16 0 100 286:20.91 14.4 1458m 1.1g 12m S
java_daemon
18427 nobody 16 0 2 391:17.48 27.7 4334m 2.2g 6200 S
java_daemon
===

sar is also reporting around 40 percent swap space being consumed.
This swap space usage varies between 30 percent and 50 percent and it
remains like this always .
But when checked with vmstat I can see no swap activity being taken
place . I monitored for around 15 minutes and can see no swap activity
although sar is reporting around 40 percent swap space being consumed
during that time period.

SAR Output
=====
12:00:01 AM kbmemfree kbmemused %memused kbbuffers kbcached
kbswpfree kbswpused %swpused kbswpcad

09:10:02 AM 77104 8083816 99.06 79664 821680
4731308 3657292 43.60 1141444
09:20:01 AM 100904 8060016 98.76 73588 803964
4736692 3651908 43.53 1143748
Average: 294668 7866252 96.39 124533 614381
5268537 3120063 37.19 622012
=====

vmstat output

===
procs -----------memory---------- ---swap-- ---io---- --
system-- ----cpu----
r b swpd free buff cache si so bi
bo in cs us sy id wa

1 0 3651908 73752 76652 812548 0 0 0 36 1058 655
13 0 87 0
1 0 3651908 69952 76688 813000 38 0 108 300 1181 36129
17 7 76 0
1 0 3651908 73408 76752 813072 0 0 6 143 1178 777
13 0 87 0
1 0 3651908 71696 76756 813036 6 0 6 33 1091
715 13 0 87 0
1 0 3651908 71440 76760 813148 45 0 45 86 1117 676
13 0 87 0
1 0 3651908 73240 76772 813136 0 0 0 17 1078 683
13 0 87 0
====


The following are my doubts :

1 Can there be any impact in performance as there is no swap
activity . Also , would like to know why swap space is getting
consumed when there is no swap activity
being taken place . Is it a sign of application leaking memory.
2. Will disabling memory overcommit will help in improving memory usage .

Any clarification will be highly appreciated .

Thanks in Advance
--
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: Clarification needed reg Linux behaviour of Swap space and Swap

am 15.05.2010 20:18:46 von Glynn Clements

query wrote:

> 1 Can there be any impact in performance as there is no swap
> activity .

No.

> Also , would like to know why swap space is getting
> consumed when there is no swap activity being taken place .

If a program has a large number of subsystems, many of these may
rarely be used, resulting in the associated memory getting swapped out
and remaining swapped out.

This is more common for interpreted languages, as they often read
and/or generate data in memory, whereas a compiled program would just
map the data from the executable or library.

This isn't really a problem, it just means that you need sufficient
swap space. Storing data in swap space doesn't impact performance if
it isn't being accessed.

> Is it a sign of application leaking memory.

Not necessarily.

> 2. Will disabling memory overcommit will help in improving memory usage .

No.

--
Glynn Clements
--
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html