From owner-freebsd-performance@FreeBSD.ORG Wed Nov 23 15:48:17 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 9C76816A41F for ; Wed, 23 Nov 2005 15:48:17 +0000 (GMT) (envelope-from m@obmail.net) Received: from stewie.obfuscated.net (stewie.obfuscated.net [66.118.188.125]) by mx1.FreeBSD.org (Postfix) with ESMTP id C4B6B43D7C for ; Wed, 23 Nov 2005 15:48:16 +0000 (GMT) (envelope-from m@obmail.net) Received: from [192.168.1.103] (163-2.26-24.tampabay.res.rr.com [24.26.2.163]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by stewie.obfuscated.net (Postfix) with ESMTP id 075156141 for ; Wed, 23 Nov 2005 10:48:11 -0500 (EST) Mime-Version: 1.0 (Apple Message framework v746.2) Content-Transfer-Encoding: 7bit Message-Id: <6C48A943-1AB3-4DF4-B8CC-CD75B9F36E98@obmail.net> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: freebsd-performance@freebsd.org From: Michael Conlen Date: Wed, 23 Nov 2005 10:48:10 -0500 X-Mailer: Apple Mail (2.746.2) Subject: 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 15:48:17 -0000 Sorry if this is the wrong place for this, but I haven't been getting answers elsewhere. I'm trying to tune the system to allow very large mmap()'s in a single process space, something on the order of 1.5 GB so I can pass very large values for -Xms and -Xmx to java. I know I had been able to do this on FreeBSD in the past but recent versions of either Java or FreeBSD aren't playing nicely. currently.. I'm running FreeBSD host 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Tue Nov 22 00:22:53 EST 2005 root@host:/usr/obj/usr/src/sys/WWW i386 I've also tried the following under 5.4-p1... I try rc = mmap(0, (891*1024*1024 + 0), 0, MAP_ANON | MAP_PRIVATE, -1, 0); and it works but If I try rc = mmap(0, (892*1024*1024 + 0), 0, MAP_ANON | MAP_PRIVATE, -1, 0); it fails returning ENOMEM. limit returns cputime unlimited filesize unlimited datasize 2096128 kbytes stacksize 1048576 kbytes coredumpsize unlimited memoryuse unlimited vmemoryuse unlimited descriptors 11095 memorylocked unlimited maxproc 5547 sbsize unlimited If the program isn't doing anything else but that is there any reason I'm getting limited in the amount of memory I can mmap() at about 892 MB? Ideally I'd like to be able to mmap most of the 2 GB available to user procs. Oh, yes, there's plenty of free memory and swap. Thanks From owner-freebsd-performance@FreeBSD.ORG Wed Nov 23 17:11:56 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 5B71816A41F for ; Wed, 23 Nov 2005 17:11:56 +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 4A8E843D5F for ; Wed, 23 Nov 2005 17:11:55 +0000 (GMT) (envelope-from arne_woerner@yahoo.com) Received: (qmail 60416 invoked by uid 60001); 23 Nov 2005 17:11:54 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=wA9gM2jp1ToMyaFVv8a+8mdhRJrdFgOa2KIy43kRMavnPX+rFoWEb+++rXgKabSFZwB2v64+SrSfsr4PLnizJpf4pLo4zhNOrtR/aLkpPmD4J3CkY1h1Di427CoQ69c89PHXGWRN7076usQIKTpGWJGqDX3iiUW98Ku6hE832Ng= ; Message-ID: <20051123171154.60414.qmail@web30307.mail.mud.yahoo.com> Received: from [213.54.79.72] by web30307.mail.mud.yahoo.com via HTTP; Wed, 23 Nov 2005 09:11:54 PST Date: Wed, 23 Nov 2005 09:11:54 -0800 (PST) From: Arne "Wörner" To: Michael Conlen , freebsd-performance@freebsd.org In-Reply-To: <6C48A943-1AB3-4DF4-B8CC-CD75B9F36E98@obmail.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: 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 17:11:56 -0000 --- Michael Conlen wrote: > I'm trying to tune the system to allow very large > mmap()'s in a > I had a similar problem with shared memory. I found an option in /sys/conf/NOTES. I think it could help in your case, if u increase % options MAXDSIZ=(1024UL*1024*1024) % options MAXSSIZ=(128UL*1024*1024) % options DFLDSIZ=(1024UL*1024*1024) apropriately. E. g. in your /sys//conf/ options MAXDSIZ=(2000UL*1024*1024) But I dont know, if that is a good idea... Maybe you should use nextboot(8) in case your box does not like the new kernel... :-) -Arne __________________________________ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com From owner-freebsd-performance@FreeBSD.ORG Wed Nov 23 17:20: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 EDE8916A41F for ; Wed, 23 Nov 2005 17:20:58 +0000 (GMT) (envelope-from m@obmail.net) Received: from stewie.obfuscated.net (stewie.obfuscated.net [66.118.188.125]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9188E43D6B for ; Wed, 23 Nov 2005 17:20:58 +0000 (GMT) (envelope-from m@obmail.net) Received: from [192.168.1.103] (163-2.26-24.tampabay.res.rr.com [24.26.2.163]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by stewie.obfuscated.net (Postfix) with ESMTP id B76B261F5; Wed, 23 Nov 2005 12:20:57 -0500 (EST) In-Reply-To: <20051123171154.60414.qmail@web30307.mail.mud.yahoo.com> References: <20051123171154.60414.qmail@web30307.mail.mud.yahoo.com> Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Message-Id: Content-Transfer-Encoding: quoted-printable From: Michael Conlen Date: Wed, 23 Nov 2005 12:20:56 -0500 To: =?ISO-8859-1?Q?Arne_W=F6rner?= X-Mailer: Apple Mail (2.746.2) 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 17:20:59 -0000 On Nov 23, 2005, at 12:11 PM, Arne W=F6rner wrote: > --- Michael Conlen wrote: >> I'm trying to tune the system to allow very large >> mmap()'s in a >> > I had a similar problem with shared memory. > > I found an option in /sys/conf/NOTES. > > I think it could help in your case, if u increase > % options MAXDSIZ=3D(1024UL*1024*1024) > % options MAXSSIZ=3D(128UL*1024*1024) > % options DFLDSIZ=3D(1024UL*1024*1024) > apropriately. > > E. g. in your /sys//conf/ > options MAXDSIZ=3D(2000UL*1024*1024) > > But I dont know, if that is a good idea... Maybe you should use > nextboot(8) in case your box does not like the new kernel... :-) I've made those changes which are reflected in the output from limit. -- Michael Conlen= From owner-freebsd-performance@FreeBSD.ORG Wed Nov 23 17:34:41 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 A6B9116A41F for ; Wed, 23 Nov 2005 17:34:41 +0000 (GMT) (envelope-from ender@tog.net) Received: from tog.net (tog.net [216.89.226.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id C752143D83 for ; Wed, 23 Nov 2005 17:34:25 +0000 (GMT) (envelope-from ender@tog.net) Received: by tog.net (Postfix, from userid 96) id 7AF8F29B66E; Wed, 23 Nov 2005 12:34:21 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.1.0-terranovanet_v6 (2005-09-13) on spamslapper.terranova.net X-Spam-Level: X-Spam-Status: No, score=-4.4 required=7.1 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.0-terranovanet_v6 Received: from [192.168.8.151] (host-216-89-225-138.terranova.net [216.89.225.138]) by tog.net (Postfix) with ESMTP id B87BA29B64B for ; Wed, 23 Nov 2005 12:34:12 -0500 (EST) Message-ID: <4384A6FD.2090201@tog.net> Date: Wed, 23 Nov 2005 12:29:33 -0500 From: ender User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-performance@freebsd.org References: <20051123171154.60414.qmail@web30307.mail.mud.yahoo.com> In-Reply-To: <20051123171154.60414.qmail@web30307.mail.mud.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit 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 17:34:41 -0000 Arne Wörner wrote: >--- Michael Conlen wrote: > > >>I'm trying to tune the system to allow very large >>mmap()'s in a >> >> >> >I had a similar problem with shared memory. > >I found an option in /sys/conf/NOTES. > >I think it could help in your case, if u increase >% options MAXDSIZ=(1024UL*1024*1024) >% options MAXSSIZ=(128UL*1024*1024) >% options DFLDSIZ=(1024UL*1024*1024) >apropriately. > >E. g. in your /sys//conf/ >options MAXDSIZ=(2000UL*1024*1024) > >But I dont know, if that is a good idea... Maybe you should use >nextboot(8) in case your box does not like the new kernel... :-) > >-Arne > > > > > > > see /boot/defaults/loader.conf or man loader.conf. I would also suggest not using your entire amount of memory in these settings. Freebsd was crashing when i set these limits to 3G. 6.0-RELEASE #0 SMP kernel. This box has 3G physical memory. kern.dfldsiz=2147483648 # Set the initial data size limit # 2G kern.dflssiz=2147483648 # Set the initial stack size limit # 2G kern.maxdsiz=2147483648 # Set the max data size # 2G kern.maxtsiz=2147483648 # Set the max text size # 2G kern.maxssiz=2147483648 # Set the max stack size # 2G From owner-freebsd-performance@FreeBSD.ORG Wed Nov 23 18:21:18 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 428E916A420 for ; Wed, 23 Nov 2005 18:21:18 +0000 (GMT) (envelope-from arne_woerner@yahoo.com) Received: from web30301.mail.mud.yahoo.com (web30301.mail.mud.yahoo.com [68.142.200.94]) by mx1.FreeBSD.org (Postfix) with SMTP id 1983543D6E for ; Wed, 23 Nov 2005 18:20:59 +0000 (GMT) (envelope-from arne_woerner@yahoo.com) Received: (qmail 99672 invoked by uid 60001); 23 Nov 2005 18:20:49 -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=jEcJsRrKR4w4r68dn/t3FIwIJdlkCE9k0VmpGmuqO4xYQtTfFjL+yg7phAFl2D7qaNePxT+xfjephBVPUjjCqiyRVCtb8ofeFpbrNYghEvPR420ZxDKVCArMhYKCdPKuKhGFvgodFU4kCeX+nx363pkeuMgFhuOzIrsjL9ScYHE= ; Message-ID: <20051123182049.99670.qmail@web30301.mail.mud.yahoo.com> Received: from [213.54.79.72] by web30301.mail.mud.yahoo.com via HTTP; Wed, 23 Nov 2005 10:20:49 PST Date: Wed, 23 Nov 2005 10:20:49 -0800 (PST) From: Arne "Wörner" To: Michael Conlen In-Reply-To: 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 18:21:18 -0000 --- Michael Conlen wrote: > On Nov 23, 2005, at 12:11 PM, Arne Wörner wrote: > > --- Michael Conlen wrote: > >> I'm trying to tune the system to allow very large > >> mmap()'s in a > >> > > I had a similar problem with shared memory. > > > > I found an option in /sys/conf/NOTES. > > > > I think it could help in your case, if u increase > > % options MAXDSIZ=(1024UL*1024*1024) > > % options MAXSSIZ=(128UL*1024*1024) > > % options DFLDSIZ=(1024UL*1024*1024) > > apropriately. > > > > E. g. in your /sys//conf/ > > options MAXDSIZ=(2000UL*1024*1024) > > > > But I dont know, if that is a good idea... Maybe > > you should use nextboot(8) in case your box does > > not like the new kernel... :-) > > I've made those changes which are reflected in the > output from limit. > Oh... Ok... That sounds plausible... 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 __________________________________ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com From owner-freebsd-performance@FreeBSD.ORG Wed Nov 23 19:32:46 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 A263716A41F for ; Wed, 23 Nov 2005 19:32:46 +0000 (GMT) (envelope-from m@obmail.net) Received: from stewie.obfuscated.net (stewie.obfuscated.net [66.118.188.125]) by mx1.FreeBSD.org (Postfix) with ESMTP id 909C743D6D for ; Wed, 23 Nov 2005 19:32:42 +0000 (GMT) (envelope-from m@obmail.net) Received: from [192.168.1.100] (unknown [66.118.181.116]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by stewie.obfuscated.net (Postfix) with ESMTP id A7EEE6141; Wed, 23 Nov 2005 14:32:41 -0500 (EST) In-Reply-To: <20051123182049.99670.qmail@web30301.mail.mud.yahoo.com> References: <20051123182049.99670.qmail@web30301.mail.mud.yahoo.com> Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Message-Id: <86229116-3E10-4277-B93D-3A9436C2F37A@obmail.net> Content-Transfer-Encoding: quoted-printable From: Michael Conlen Date: Wed, 23 Nov 2005 14:32:40 -0500 To: =?ISO-8859-1?Q?Arne_W=F6rner?= X-Mailer: Apple Mail (2.746.2) 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:32:46 -0000 On Nov 23, 2005, at 1:20 PM, Arne W=F6rner wrote: > --- Michael Conlen wrote: >> On Nov 23, 2005, at 12:11 PM, Arne W=F6rner wrote: >>> --- Michael Conlen wrote: >>>> I'm trying to tune the system to allow very large >>>> mmap()'s in a >>>> >>> I had a similar problem with shared memory. >>> >>> I found an option in /sys/conf/NOTES. >>> >>> I think it could help in your case, if u increase >>> % options MAXDSIZ=3D(1024UL*1024*1024) >>> % options MAXSSIZ=3D(128UL*1024*1024) >>> % options DFLDSIZ=3D(1024UL*1024*1024) >>> apropriately. >>> >>> E. g. in your /sys//conf/ >>> options MAXDSIZ=3D(2000UL*1024*1024) >>> >>> But I dont know, if that is a good idea... Maybe >>> you should use nextboot(8) in case your box does >>> not like the new kernel... :-) >> >> I've made those changes which are reflected in the >> output from limit. >> > Oh... Ok... That sounds plausible... > > 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 =3D > 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 =20= data size and edited the loader.conf to include those options as well =20= with the same result. I really believe the system is being limited =20 elsewhere. -- Michael Conlen= 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 From owner-freebsd-performance@FreeBSD.ORG Wed Nov 23 20:15:20 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 A8A6716A41F for ; Wed, 23 Nov 2005 20:15:20 +0000 (GMT) (envelope-from m@obmail.net) Received: from stewie.obfuscated.net (stewie.obfuscated.net [66.118.188.125]) by mx1.FreeBSD.org (Postfix) with ESMTP id 55A9843D46 for ; Wed, 23 Nov 2005 20:15:20 +0000 (GMT) (envelope-from m@obmail.net) Received: from [192.168.1.100] (unknown [66.118.181.116]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by stewie.obfuscated.net (Postfix) with ESMTP id CFEF66141; Wed, 23 Nov 2005 15:15:19 -0500 (EST) In-Reply-To: <20051123195647.27712.qmail@web30307.mail.mud.yahoo.com> References: <20051123195647.27712.qmail@web30307.mail.mud.yahoo.com> Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Message-Id: <61C1776C-7192-41D8-AE6E-65319B141259@obmail.net> Content-Transfer-Encoding: quoted-printable From: Michael Conlen Date: Wed, 23 Nov 2005 15:15:18 -0500 To: =?ISO-8859-1?Q?Arne_W=F6rner?= X-Mailer: Apple Mail (2.746.2) 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 20:15:20 -0000 On Nov 23, 2005, at 2:56 PM, Arne W=F6rner wrote: > --- Michael Conlen wrote: >> On Nov 23, 2005, at 1:20 PM, Arne W=F6rner 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 =3D >>> >> > 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)? Well, I'm not trying to use mmap() this way per say, java 1.4.2 and =20 1.5.0 built from ports is. I have verified that I can malloc() much more memory that I can mmap=20 (). I'm looking at the code for mmap() and I can't find a resource =20 limit that would normally return ENOMEM that is set too low. -- Michael Conlen= From owner-freebsd-performance@FreeBSD.ORG Wed Nov 23 20:47:21 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 72B7D16A420 for ; Wed, 23 Nov 2005 20:47:21 +0000 (GMT) (envelope-from ntarmos@ceid.upatras.gr) Received: from poseidon.ceid.upatras.gr (poseidon.ceid.upatras.gr [150.140.141.169]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7659F43D6E for ; Wed, 23 Nov 2005 20:47:13 +0000 (GMT) (envelope-from ntarmos@ceid.upatras.gr) Received: from rhea.ceid.upatras.gr (rhea.ceid.upatras.gr [150.140.141.171]) by poseidon.ceid.upatras.gr (Postfix) with ESMTP id 696175C1725 for ; Wed, 23 Nov 2005 22:47:10 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by rhea.ceid.upatras.gr (Postfix) with ESMTP id 5AB5080008 for ; Wed, 23 Nov 2005 22:47:09 +0200 (EET) Received: from rhea.ceid.upatras.gr ([127.0.0.1]) by localhost (rhea [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 20877-09 for ; Wed, 23 Nov 2005 22:47:07 +0200 (EET) Received: from ceid.upatras.gr (diogenis.ceid.upatras.gr [150.140.141.181]) by rhea.ceid.upatras.gr (Postfix) with ESMTP id 17F2680006 for ; Wed, 23 Nov 2005 22:47:05 +0200 (EET) Received: by ceid.upatras.gr (nbSMTP-1.00) for uid 1001 ntarmos@ceid.upatras.gr; Wed, 23 Nov 2005 22:46:58 +0200 (EET) Date: Wed, 23 Nov 2005 22:46:58 +0200 From: Nikos Ntarmos To: freebsd-performance@freebsd.org Message-ID: <20051123204658.GA44301@diogenis.ceid.upatras.gr> Mail-Followup-To: Nikos Ntarmos , freebsd-performance@freebsd.org References: <20051123195647.27712.qmail@web30307.mail.mud.yahoo.com> <61C1776C-7192-41D8-AE6E-65319B141259@obmail.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; x-action=pgp-signed Content-Disposition: inline In-Reply-To: <61C1776C-7192-41D8-AE6E-65319B141259@obmail.net> Organization: NetCInS Lab., C.E.I.D., U. of Patras, Greece WWW-Homepage: http://noth.ceid.upatras.gr/ X-PGP-Fingerprint: 9680 60A7 DE60 0298 B1F0 9B22 9BA2 7569 CF95 160A Office-Phone: +30-2610-996919 Office-Fax: +30-2610-969011 GPS-Info: 38.2594N, 21.7428E User-Agent: Mutt/1.5.11 X-Virus-Scanned: by amavisd-new at ceid.upatras.gr 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 20:47:21 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi there. What is the value of vm.max_proc_mmap? Also, what is the value of KVA_PAGES in your kernel config? \n\n -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) Comment: Nikos Ntarmos iD8DBQFDhNVCm6J1ac+VFgoRAhLJAJ94JUg7lhBZd0cNKYDp4/sMaz9IbACfX5l+ 8C6PpZ8n6l6vrJugRPVIHJc= =cifJ -----END PGP SIGNATURE----- From owner-freebsd-performance@FreeBSD.ORG Wed Nov 23 22:21:49 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 27C9B16A41F for ; Wed, 23 Nov 2005 22:21:49 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id D2B0743D49 for ; Wed, 23 Nov 2005 22:21:48 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id D68FC46B89; Wed, 23 Nov 2005 17:21:47 -0500 (EST) Date: Wed, 23 Nov 2005 22:21:47 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Michael Conlen In-Reply-To: <6C48A943-1AB3-4DF4-B8CC-CD75B9F36E98@obmail.net> Message-ID: <20051123221952.D32130@fledge.watson.org> References: <6C48A943-1AB3-4DF4-B8CC-CD75B9F36E98@obmail.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed 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 22:21:49 -0000 On Wed, 23 Nov 2005, Michael Conlen wrote: > Sorry if this is the wrong place for this, but I haven't been getting > answers elsewhere. > > I'm trying to tune the system to allow very large mmap()'s in a single > process space, something on the order of 1.5 GB so I can pass very large > values for -Xms and -Xmx to java. I know I had been able to do this on > FreeBSD in the past but recent versions of either Java or FreeBSD aren't > playing nicely. currently.. BTW, you may find it useful to use procfs to inspect the address space layout of your process. You can d: mkdir /proc mount -t procfs proc /proc cd /proc/pid dd if=map of=/dev/stdout bs=20k This can help you look for fragmentation of process address space, among other things. Robert N M Watson > > I'm running > > FreeBSD host 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Tue Nov 22 00:22:53 EST 2005 > root@host:/usr/obj/usr/src/sys/WWW i386 > > I've also tried the following under 5.4-p1... > > I try > > rc = mmap(0, (891*1024*1024 + 0), 0, MAP_ANON | MAP_PRIVATE, -1, 0); > > and it works but If I try > > rc = mmap(0, (892*1024*1024 + 0), 0, MAP_ANON | MAP_PRIVATE, -1, 0); > > it fails returning ENOMEM. > > limit returns > > cputime unlimited > filesize unlimited > datasize 2096128 kbytes > stacksize 1048576 kbytes > coredumpsize unlimited > memoryuse unlimited > vmemoryuse unlimited > descriptors 11095 > memorylocked unlimited > maxproc 5547 > sbsize unlimited > > If the program isn't doing anything else but that is there any reason I'm > getting limited in the amount of memory I can mmap() at about 892 MB? Ideally > I'd like to be able to mmap most of the 2 GB available to user procs. > > Oh, yes, there's plenty of free memory and swap. > > Thanks > > > _______________________________________________ > freebsd-performance@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-performance > To unsubscribe, send any mail to > "freebsd-performance-unsubscribe@freebsd.org" > From owner-freebsd-performance@FreeBSD.ORG Thu Nov 24 18:05:52 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 2E33B16A41F for ; Thu, 24 Nov 2005 18:05:52 +0000 (GMT) (envelope-from m@obmail.net) Received: from stewie.obfuscated.net (stewie.obfuscated.net [66.118.188.125]) by mx1.FreeBSD.org (Postfix) with ESMTP id 53B2B43D46 for ; Thu, 24 Nov 2005 18:05:44 +0000 (GMT) (envelope-from m@obmail.net) Received: from [192.168.1.101] (163-2.26-24.tampabay.res.rr.com [24.26.2.163]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by stewie.obfuscated.net (Postfix) with ESMTP id D303361F5 for ; Thu, 24 Nov 2005 13:05:38 -0500 (EST) Mime-Version: 1.0 (Apple Message framework v746.2) In-Reply-To: <20051123221952.D32130@fledge.watson.org> References: <6C48A943-1AB3-4DF4-B8CC-CD75B9F36E98@obmail.net> <20051123221952.D32130@fledge.watson.org> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <3EF0A80D-0577-46E2-9143-B849CFF48197@obmail.net> Content-Transfer-Encoding: 7bit From: Michael Conlen Date: Thu, 24 Nov 2005 13:05:39 -0500 To: freebsd-performance@freebsd.org X-Mailer: Apple Mail (2.746.2) 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: Thu, 24 Nov 2005 18:05:52 -0000 On Nov 23, 2005, at 5:21 PM, Robert Watson wrote: > > On Wed, 23 Nov 2005, Michael Conlen wrote: > >> Sorry if this is the wrong place for this, but I haven't been >> getting answers elsewhere. >> >> I'm trying to tune the system to allow very large mmap()'s in a >> single process space, something on the order of 1.5 GB so I can >> pass very large values for -Xms and -Xmx to java. I know I had >> been able to do this on FreeBSD in the past but recent versions of >> either Java or FreeBSD aren't playing nicely. currently.. > > BTW, you may find it useful to use procfs to inspect the address > space layout of your process. You can d: > > mkdir /proc > mount -t procfs proc /proc > cd /proc/pid > dd if=map of=/dev/stdout bs=20k > > This can help you look for fragmentation of process address space, > among other things. Thanks. I forgot when you mmap you have to have contiguous space... ... 0x8048000 0x8049000 0 0 0xc3c79630 r-x 1 0 0x0 COW NC vnode /tmp/foo 0x8049000 0x804a000 1 0 0xc5ad718c rw- 2 0 0x2180 NCOW NNC default - 0x804a000 0x804c000 2 0 0xc5ad718c rwx 2 0 0x2180 NCOW NNC default - 0x87f49000 0x87f69000 32 0 0xc10406b4 r-x 80 29 0x4 COW NC vnode / libexec/ld-elf That looks like about 2 GB of space between the last two lines. The rest is as follows 0x87f69000 0x87f6a000 1 0 0xc5ae1d68 rw- 1 0 0x2180 COW NNC vnode / libexec/ld-elf.so.1 0x87f6a000 0x87f6f000 5 0 0xc3b4db58 rw- 2 0 0x2180 NCOW NNC default - 0x87f6f000 0x87f77000 7 0 0xc3b4db58 rwx 2 0 0x2180 NCOW NNC default - 0x87f77000 0x88041000 108 0 0xc3b3bd68 r-x 1 0 0x2180 COW NNC vnode / lib/libc.so.5 0x88041000 0x88042000 1 0 0xc5ad6840 r-x 1 0 0x2180 COW NNC vnode / lib/libc.so.5 0x88042000 0x88047000 5 0 0xc5ad418c rwx 1 0 0x2180 COW NNC vnode / lib/libc.so.5 0x88047000 0x8805c000 6 0 0xc5ad75ac rwx 1 0 0x2180 NCOW NNC default - 0xbfbe0000 0xbfc00000 3 0 0xc3c9718c rwx 1 0 0x2180 NCOW NNC default - If I change from using mmap to malloc() I get the following first four lines show malloc() on the heap 0x8048000 0x8049000 1 0 0xc3b2c318 r-x 1 0 0x0 COW NC vnode /tmp/foo 0x8049000 0x804a000 1 0 0xc5ae3108 rw- 2 0 0x2180 NCOW NNC default - 0x804a000 0x3fc4c000 2 0 0xc5ae3108 rwx 2 0 0x2180 NCOW NNC default - 0x87f49000 0x87f69000 32 0 0xc10406b4 r-x 83 31 0x4 COW NC vnode / libexec/ld-elf and it looks like a smaller mmap() shows up at the end 0x88041000 0x88042000 1 0 0xc5adcce4 r-x 1 0 0x2180 COW NNC vnode / lib/libc.so.5 0x88042000 0x88047000 5 0 0xc5ad6420 rwx 1 0 0x2180 COW NNC vnode / lib/libc.so.5 0x88047000 0x8805b000 5 0 0xc5ae1ce4 rwx 3 0 0x2180 NCOW NNC default - 0x8805b000 0xbfb5b000 0 0 0xc5ae1ce4 --- 3 0 0x2180 NCOW NNC default - 0xbfb5b000 0xbfb5c000 1 0 0xc5ae1ce4 rwx 3 0 0x2180 NCOW NNC default - I presume the stack is coming up from the bottom. The end looks about 5 MB short of 3 GB. In all it looks like about 1 GB off the top (kernel I presume), the heap, followed by the libraries which IIRC are mmap()'ed coming down after the end of the heap and I presume the stack coming up from the bottom. If I reduce the limit for the datasize locally using limit it doesn't seem to actually free up space for the stack. If I change loader.conf to reduce the datasize then the space is freed up to do the mmap(). If I leave the max datasize and reduce the default to 1 GB I don't get any change in the memory map at all. So here's the problem, I've got a DB server that needs a large datasize and a tomcat server which occasionally needs to use a lot of memory, which java allocates from a memory mapped space. Any ideas how to get the system to allow processes to have either/or? -- Michael Conlen From owner-freebsd-performance@FreeBSD.ORG Thu Nov 24 18:05:55 2005 Return-Path: X-Original-To: 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 00E6616A41F for ; Thu, 24 Nov 2005 18:05:55 +0000 (GMT) (envelope-from ricardo_bsd@yahoo.com.br) Received: from maritaca.epm.br (disrouter.epm.br [200.17.25.161]) by mx1.FreeBSD.org (Postfix) with ESMTP id E945443D93 for ; Thu, 24 Nov 2005 18:05:46 +0000 (GMT) (envelope-from ricardo_bsd@yahoo.com.br) Received: from localhost (localhost.localdomain [127.0.0.1]) by maritaca.epm.br (Postfix) with ESMTP id F0E1A3948 for ; Thu, 24 Nov 2005 16:05:39 -0200 (BRDT) Received: from [172.22.1.166] (ricardo.epm.br [172.22.1.166]) by maritaca.epm.br (Postfix) with ESMTP id 986D13946 for ; Thu, 24 Nov 2005 16:05:35 -0200 (BRDT) Message-ID: <438600DD.10608@yahoo.com.br> Date: Thu, 24 Nov 2005 16:05:17 -0200 From: "Ricardo A. Reis" User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051122) X-Accept-Language: en-us, en MIME-Version: 1.0 To: performance@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit UNIFESP-Virus-Scanned: by amavisd-new at dis.epm.br Cc: Subject: Libmicro!! pthread_create Resource temporarily unavailable 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: Thu, 24 Nov 2005 18:05:55 -0000 Hi all, Recently i uncovered libmicro work in freebsd, but after install from ports my first test using pthread_create not work. Using default or custom parameters in pthread_create i see this messages on dmesg , pthread_create: Resource temporarily unavailable # sysctl -a |grep thread kern.threads.thr_concurrency: 0 kern.threads.thr_scope: 0 kern.threads.virtual_cpu: 2 kern.threads.max_threads_hits: 0 kern.threads.max_groups_per_proc: 1500 kern.threads.max_threads_per_proc: 1500 kern.threads.debug: 0 Hyperthreading: 2 logical CPUs Hyperthreading: 2 logical CPUs vm.stats.vm.v_kthreadpages: 0 vm.stats.vm.v_kthreads: 67 machdep.hyperthreading_allowed: 1 #limit cputime unlimited filesize unlimited datasize 512MB stacksize 64MB coredumpsize unlimited memoryuse unlimited memorylocked unlimited maxproc 3603 descriptors 7207 sockbufsize unlimited vmemorysize unlimited what is the problem? pthread_create ? Thanks Ricardo A. Reis UNIFESP From owner-freebsd-performance@FreeBSD.ORG Thu Nov 24 18:28:16 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 82E3016A426 for ; Thu, 24 Nov 2005 18:28:16 +0000 (GMT) (envelope-from joseph.koshy@gmail.com) Received: from xproxy.gmail.com (xproxy.gmail.com [66.249.82.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id 610D543D5A for ; Thu, 24 Nov 2005 18:27:40 +0000 (GMT) (envelope-from joseph.koshy@gmail.com) Received: by xproxy.gmail.com with SMTP id s9so1441396wxc for ; Thu, 24 Nov 2005 10:27:37 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=QDZZBihwtgSBGjsE5Wp6TiF2E7D4DPuQS3qloLWg807NJ+UPIcoGSh5k536UltQAngb4ns/47dtMj725jtRXkblLLLJj+DONnvh1K3k9KswYsSm12DYjfQZ+zF6Zy6+KBwxda93+dc2Z5A2xptI17K+zVyEbCGbK5Lxz3DfOLe8= Received: by 10.70.54.9 with SMTP id c9mr6708333wxa; Thu, 24 Nov 2005 10:21:08 -0800 (PST) Received: by 10.70.105.13 with HTTP; Thu, 24 Nov 2005 10:21:08 -0800 (PST) Message-ID: <84dead720511241021r5e591559l645a8ffe0a1e5a95@mail.gmail.com> Date: Thu, 24 Nov 2005 23:51:08 +0530 From: Joseph Koshy To: Michael Conlen In-Reply-To: <3EF0A80D-0577-46E2-9143-B849CFF48197@obmail.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <6C48A943-1AB3-4DF4-B8CC-CD75B9F36E98@obmail.net> <20051123221952.D32130@fledge.watson.org> <3EF0A80D-0577-46E2-9143-B849CFF48197@obmail.net> 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: Thu, 24 Nov 2005 18:28:16 -0000 > So here's the problem, I've got a DB server that needs a > large datasize and a tomcat server which occasionally needs > to use a lot of memory, which java allocates from a memory > mapped space. Any ideas how to get the system to allow > processes to have either/or? IIRC, the process layout is something like the following (Kernel) ~0..[VM_MAXUSER_ADDRESS] Stack bottom (includes char *environment etc.) ... Current top of stack (Space for mmapp'ed objects.) >highest possible data segment address< malloc arena (heap) .bss .data .text >start of text< (gap) Virtual address 0 Possible solutions could be: - link statically (i.e., don't fragment the mmap arena) - reduce the data segment size (i.e., reduce the malloc arena size) by tweaking the run time limits associated with the process. -- FreeBSD Volunteer, http://people.freebsd.org/~jkoshy