lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 01 Jul 2009 17:15:38 -0600
From:	Zan Lynx <zlynx@....org>
To:	Attila Kinali <attila@...ali.ch>
CC:	Robert Hancock <hancockrwd@...il.com>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org
Subject: Re: Long lasting MM bug when swap is smaller than RAM

Attila Kinali wrote:
> On Wed, 1 Jul 2009 10:04:32 +0200
> Attila Kinali <attila@...ali.ch> wrote:
> 
>>> But 
>>> swapping does not only occur if memory is running low. If disk usage is 
>>> high then non-recently used data may be swapped out to make more room 
>>> for disk caching.
>> Hmm..I didn't know this.. thanks!
> 
> This was the cause of the problem!
> 
> I just restarted svnserv, clamav and bind (the three applications
> using most memory) and suddenly swap cleared up.
> 
> Now the question is, why did they accumulate so much used swap
> space, while before the RAM upgrade, we hardly used the swap space at all?

I do not know about the others, but ClamAV suffers from pretty serious 
memory fragmentation.  What it does is load the updated signatures into 
a new memory allocation, verify them, then free the old signature 
allocation.  This results in a large hole in glibc's malloc structures 
and because of ClamAV's allocation pattern, this hole is difficult to 
reclaim.  This ClamAV memory fragmentation will continue to grow worse 
until the daemon is completely restarted.

Under memory pressure the kernel pushes least used pages out to swap, 
and these unused but still allocated pages of ClamAV are never again 
used, so out to swap they go.

I know this because the company I work for tried to fix the memory 
allocation fragmentation of ClamAV, but they did not like our patch and 
preferred to continue allowing the memory allocator to fragment in 
exchange for simpler code.

-- 
Zan Lynx
zlynx@....org

"Knowledge is Power.  Power Corrupts.  Study Hard.  Be Evil."
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ