From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 6 15:12:47 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37DA8106566B for ; Thu, 6 Oct 2011 15:12:47 +0000 (UTC) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from wojtek.tensor.gdynia.pl (wojtek.tensor.gdynia.pl [89.206.35.99]) by mx1.freebsd.org (Postfix) with ESMTP id 998CB8FC17 for ; Thu, 6 Oct 2011 15:12:46 +0000 (UTC) Received: from wojtek.tensor.gdynia.pl (localhost [127.0.0.1]) by wojtek.tensor.gdynia.pl (8.14.5/8.14.4) with ESMTP id p96Efk3u015561; Thu, 6 Oct 2011 16:41:46 +0200 (CEST) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from localhost (wojtek@localhost) by wojtek.tensor.gdynia.pl (8.14.5/8.14.4/Submit) with ESMTP id p96Efjs8015558; Thu, 6 Oct 2011 16:41:45 +0200 (CEST) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Date: Thu, 6 Oct 2011 16:41:45 +0200 (CEST) From: Wojciech Puchar To: hackers@freebsd.org Message-ID: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.7 (wojtek.tensor.gdynia.pl [127.0.0.1]); Thu, 06 Oct 2011 16:41:46 +0200 (CEST) Cc: Grzegorz Kulewski Subject: mmap performance and memory use X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Oct 2011 15:12:47 -0000 i have few questions. 1) suppose i map 1TB of address space as anonymous and touch just one page. how much memory is used to manage this? 2) suppose we have 1TB file on disk without holes and 100000 processes mmaps this file to it's address space. are just pages shared or can pagetables be shared too? how much memory is used to manage such situation? yes this is a real question - assume most of these processes are mostly sleeping but every now and then do something and work of some set of pages from this file and there is enough memory in computer to keep this working set, but only if managing it by OS will not overuse memory.