[Bug 523024] Re: system thrashes even with lots of free memory

Russell Robinson russellr at openconcepts.com.au
Wed Mar 10 21:26:05 UTC 2010


Hi,

I can provide more information on this now.

I reduced the RAM sizes of the two guests and, with these sysctl settings, I don't seem to get the big thrashing occurrences:
vm.overcommit_memory = 2
vm.overcommit_ratio = 10

# Perhaps the min_free_kbytes is causing swapping to go on for too long.
# The booted value was 8079.
vm.min_free_kbytes = 2000

# Swap I/O size of 128KB
vm.page-cluster = 5

I've set page-cluster = 5 because my SSD drive seems to prefer larger
I/O to get the best performance.

I've also set the I/O scheduler on the SSD to "deadline" with a
fifo_batch size of 1.

The guest RAM is set to 512MB (WinXP) and 640MB (linux).

This avoids the thrashing, but, two important observations:
1. Quite often the guests will hang for no apparent reason for many seconds (10-20 seonds).  I/O appears to be happening at this time, but the evidence (VMware disk icon lights, hard disk light, iostat output) is not always supportive of this.
2. The total RAM usage makes no sense.

On point 2.  A freshly booted host looks great. Plenty of free RAM,
everything process resident, no swap.  Over time, the RAM gets all used
up, some swap is users, and the RSS of the VMware guest processes goes
down.

Where does the memory go?

I'm now suspecting a memory leak in the kernel.

Since I'm wasting so much time on this, I've forked out $500 to upgrade
to 8GB of RAM.

I've boosted the two VMs to be 1200MB RAM each, and this should leave
around 3GB of free RAM - which it does on initial boot.

No thrashing now, but I do still get the two points above.

Furthermore, I've written a script to go through /proc/*/smaps and add
up the RSS and PSS of all processes.

Here's the result (about 260 processes):
Total: RSS=2472224 PSS=2078454 Total= 4550678 kB

Add in 1GB for the kernel, and I seem to be missing 2.5GB.

Here's what top is saying:
Mem:   8146584k total,  8101588k used,    44996k free,   272980k buffers
Swap: 16204180k total,    85984k used, 16118196k free,  6248028k cached

It looks to me like I'm missing up to 3GB of RAM.

Is this a memory leak or am I missing something?

regards,
RR

-- 
system thrashes even with lots of free memory
https://bugs.launchpad.net/bugs/523024
You received this bug notification because you are a member of Kernel
Bugs, which is subscribed to linux in ubuntu.




More information about the kernel-bugs mailing list