From owner-freebsd-performance@FreeBSD.ORG Wed Nov 23 19:56:58 2005 Return-Path: X-Original-To: freebsd-performance@freebsd.org Delivered-To: freebsd-performance@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D5B4916A420 for ; Wed, 23 Nov 2005 19:56:58 +0000 (GMT) (envelope-from arne_woerner@yahoo.com) Received: from web30307.mail.mud.yahoo.com (web30307.mail.mud.yahoo.com [68.142.200.100]) by mx1.FreeBSD.org (Postfix) with SMTP id 888B443D60 for ; Wed, 23 Nov 2005 19:56:57 +0000 (GMT) (envelope-from arne_woerner@yahoo.com) Received: (qmail 27715 invoked by uid 60001); 23 Nov 2005 19:56:47 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=GBW8xN231rWSXp715TP46vK4llcvFAJupSed2e9NokUDf+yIkIxhwCkfQlBGilkW2SgbximVu1i+UJfxmfClubq/6oAQHTYSbsd+lVQes8oH828oJdJENNMyWP2tgbe0I9pmYP2kuoueZm1L7hsFZPMdX6kDf7upOmeeQFGLfQA= ; Message-ID: <20051123195647.27712.qmail@web30307.mail.mud.yahoo.com> Received: from [213.54.97.1] by web30307.mail.mud.yahoo.com via HTTP; Wed, 23 Nov 2005 11:56:47 PST Date: Wed, 23 Nov 2005 11:56:47 -0800 (PST) From: Arne "Wörner" To: Michael Conlen In-Reply-To: <86229116-3E10-4277-B93D-3A9436C2F37A@obmail.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: freebsd-performance@freebsd.org Subject: Re: mmap() X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2005 19:56:58 -0000 --- Michael Conlen wrote: > On Nov 23, 2005, at 1:20 PM, Arne Wörner wrote: > > Maybe the stack size matters in ur case somehow? I can see, > that > > it is limited to 1GB, isn't it? > > > > I found something funny, too: > >> limit > > cputime unlimited > > filesize unlimited > > datasize 524288 kbytes > > stacksize 65536 kbytes > > coredumpsize unlimited > > memoryuse unlimited > > vmemoryuse unlimited > > descriptors 6861 > > memorylocked unlimited > > maxproc 3430 > > sbsize unlimited > >> c++ -o mmap mmap.c > >> ./mmap 757254143 > > sz2d22c7ff00000 r673435648 errno0 > >> cat mmap.c > > #include > > #include > > #include > > #include > > > > int main(const int argc, char ** argv) { > > void * r = > > > mmap(0,atoi(argv[argc-1])*1024LL*1024,0,MAP_ANON|MAP_PRIVATE,-1,0); > > printf("sz%llx r%d > > errno%d\n",atoi(argv[argc-1])*1024LL*1024,r,errno); > > return 0; > > } > > > > > > -Arne > > > > At this point I have updated the kernel to include > 2 GB for stack and data size and edited the > loader.conf to include those options as well > with the same result. I really believe the system is > being limited elsewhere. > But why can I get so much memory (722TB) with mmap (even with the default MAXDSIZ in my kernel)? Maybe we use mmap(2) the wrong way (I just used it with files: I found it fancier to write to a file via mmap(2)'ed memory)? > ./mmap 100 sz6400000 r673435648 errno0 > ./mmap 200 szc800000 r673435648 errno0 > ./mmap 300 sz12c00000 r673435648 errno0 > ./mmap 400 sz19000000 r673435648 errno0 > ./mmap 500 sz1f400000 r673435648 errno0 > ./mmap 600 sz25800000 r673435648 errno0 > ./mmap 700 sz2bc00000 r673435648 errno0 > ./mmap 800 sz32000000 r673435648 errno0 > ./mmap 900 sz38400000 r673435648 errno0 > ./mmap 1024 sz40000000 r673435648 errno0 > ./mmap 710000 szad57000000 r673435648 errno0 > ./mmap 720000 szafc8000000 r-1 errno22 -Arne P. S.: This reminds me a little bit on the Futurama episode, where Prof. Farnsworth and his crew travelled back in time to an US army base, where this funny reporter was unable to get a single clear and unmorphed photo (he just got a "Nessie"-like pattern and white spots on black background...)... __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com