From owner-freebsd-stable@FreeBSD.ORG Thu Oct 30 02:44:06 2014 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 627CD5C7 for ; Thu, 30 Oct 2014 02:44:06 +0000 (UTC) Received: from mail-la0-x22d.google.com (mail-la0-x22d.google.com [IPv6:2a00:1450:4010:c03::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E1CF1E96 for ; Thu, 30 Oct 2014 02:44:05 +0000 (UTC) Received: by mail-la0-f45.google.com with SMTP id gm9so3665002lab.18 for ; Wed, 29 Oct 2014 19:44:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=lk5cUGthcwRePY1fqvlYvt5mUBGSNcywqx+Fndcapns=; b=Zs5CpCoJKgSQJf8Y36rP/8ggPw8QjSyymMYcjmIm0QRgMAmnE/4bOEudNlb8QcwS14 ATlefggDitrmGPXuYTjTjN3VB2FXj0WXPykQ0wTd4zlhek11zBlR0YC+d0krZ8gqj0BI vABGABO75lbkv4wBYqCQiMG0AHVu+CBlgfE4wAggHhSo8rk5+NYzLqOwLJt3VC7Io/XX WsFWpXVoXjz5aejXfReDKiLL2+8Uw1n5cXcyasd2WOiyPNoXQeH/S+b55ioB+kb4yBcR Jw31QNjsaEX7MwLeY/QqxRNQN7I/QALRoNXYh/Gqbc5GitZuvyOcVHUO+mQs+3R3WdEv XGbg== MIME-Version: 1.0 X-Received: by 10.152.9.201 with SMTP id c9mr15335285lab.38.1414637043277; Wed, 29 Oct 2014 19:44:03 -0700 (PDT) Received: by 10.25.0.6 with HTTP; Wed, 29 Oct 2014 19:44:03 -0700 (PDT) In-Reply-To: <20141030100853.65a62326@akips.com> References: <20141030100853.65a62326@akips.com> Date: Wed, 29 Oct 2014 22:44:03 -0400 Message-ID: Subject: Re: Suspected kernel memory leak with mmap/sha1 ? From: Ryan Stone To: Paul Koch Content-Type: text/plain; charset=UTF-8 Cc: "freebsd-stable@freebsd.org" X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 02:44:06 -0000 This is normal behaviour. Active (and inactive) memory comprises both application memory and system disk cache. By reading in all of those files, you have loaded the contents of those files into the cache, which is counted as active memory. The kernel has no preference between disk cache or application memory. Its decisions as to whether to swap application data out to disk or discard a page of disk cache are mainly based on the VM system's estimates of how often that data is being read. One test that you could perform is to run your app with swap disabled. If your application runs faster with swap disabled, that indicates that the VM subsystem's heuristics are suboptimal for your workload and some tuning might be necessary. If your application runs at the same speed or slower, then the VM subsystem is making correct (if counter-intuitive) decisions performance-wise. In that case, if your performance is still unacceptable then your options are either to tune your app's algorithm to reduce its working set (including application and file data) to fit into memory, or install more memory in the machine.