From owner-freebsd-questions@FreeBSD.ORG Wed May 21 10:09:30 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDBCA1065682 for ; Wed, 21 May 2008 10:09:30 +0000 (UTC) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from wojtek.tensor.gdynia.pl (wojtek.tensor.gdynia.pl [IPv6:2001:4070:101:2::1]) by mx1.freebsd.org (Postfix) with ESMTP id 9793E8FC0C for ; Wed, 21 May 2008 10:09:28 +0000 (UTC) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from wojtek.tensor.gdynia.pl (localhost [IPv6:::1]) by wojtek.tensor.gdynia.pl (8.14.2/8.14.2) with ESMTP id m4LA9EoB006605; Wed, 21 May 2008 12:09:14 +0200 (CEST) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from localhost (wojtek@localhost) by wojtek.tensor.gdynia.pl (8.14.2/8.14.2/Submit) with ESMTP id m4LA9Egi006602; Wed, 21 May 2008 12:09:14 +0200 (CEST) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Date: Wed, 21 May 2008 12:09:14 +0200 (CEST) From: Wojciech Puchar To: Brad Penoff In-Reply-To: Message-ID: <20080521120905.T6581@wojtek.tensor.gdynia.pl> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-questions@freebsd.org Subject: Re: resident memory limit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2008 10:09:31 -0000 > a problem when I run on FreeBSD (6.3 or 7). The issue is the memory > footprint for the application (osubw_sctpclien below) is quite large; > on Linux it can be as much as 950 MB in resident memory, according to > top. However, on FreeBSD I start to get ENOMEM always around the time > my resident memory size is about 200 MB. > check ulimit then fix login.conf > I read a few posts and have seen people fixing their problems by > adjusting kern.maxdsiz in /boot/loader.conf and/or by adding a swap > file. I've tried both and for my application, it still seems to be > limited to 200 MB resident memory regardless of maxdsize and swap file > setting. I wrote a toy application (malloctest below) that calls > malloc in a while(1) and breaks once it gets ENOMEM (doing another > while(1) so it doesn't exit); this application's memory size in top > always matches the kern.maxdsiz setting, however it has a very low > resident memory number, according to top. > > I have all the data below from these two applications. For > malloctest, I can malloc as much as maxdsiz allows (without panic'ing > the kernel). My main question is, in FreeBSD how can I increase the > permitted resident memory of the system for my application to beyond > 200 MB? Any ideas where this 200 MB resident memory limit is coming > from? Why (in the last data entry below) does the resident memory > limit become 80 MB after I increase maxdsiz AND use a swap file (the > settings where malloctest can malloc the most!)? > > Thanks! > brad > > > Using FreeBSD 6.3..... > > > kern.maxdsiz default setting ( 524288 kB ) > no swap file. > > Mem: 218M Active, 9184K Inact, 36M Wired, 14M Buf, 1739M Free > Swap: 512M Total, 512M Free > > PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND > 978 root 4 118 0 203M 201M RUN 0:12 0.00% osubw_sctpclien > > ... separate run... > > 969 penoff 1 125 0 513M 1144K RUN 0:09 90.73% malloctest > > ------------------------------------------ > > kern.maxdsiz default setting ( 524288 kB ) > 512 MB swap file. > > Mem: 218M Active, 9144K Inact, 36M Wired, 12K Cache, 14M Buf, 1739M Free > Swap: 1024M Total, 1024M Free > > PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND > 982 root 3 120 0 203M 201M RUN 0:13 0.00% osubw_sctpclien > > ... separate run... > > 967 penoff 1 126 0 513M 1144K RUN 0:10 94.60% malloctest > > ------------------------------------------ > > > kern.maxdsiz="2147483648" # Set the max data size > no swap file. > > Mem: 218M Active, 9168K Inact, 36M Wired, 14M Buf, 1739M Free > Swap: 512M Total, 512M Free > > PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND > 967 root 3 122 0 203M 201M RUN 0:31 0.00% osubw_sctpclien > > ... separate run... > > 980 root 1 129 0 2050M 2680K RUN 0:12 97.64% malloctest > > > ---------------------------------------- > > kern.maxdsiz="2147483648" # Set the max data size > 512 MB swap file. > > Mem: 220M Active, 12M Inact, 41M Wired, 12K Cache, 20M Buf, 1730M Free > Swap: 1024M Total, 1024M Free > > PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND > 1041 root 4 20 0 204M 202M kserel 0:04 0.00% osubw_sctpclien > > ... separate run... > > 967 root 1 121 0 2050M 2680K RUN 0:07 93.16% malloctest > > ---------------------------------------- > kern.maxdsiz="3000000000" > no swap file > > kernel panic > ---------------------------------------- > > kern.maxdsiz="3000000000" # Set the max data size > 512 MB swap file. > > > Mem: 103M Active, 52M Inact, 106M Wired, 112M Buf, 1742M Free > Swap: 1024M Total, 1024M Free > > PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND > 15286 root 2 128 0 81172K 79080K RUN 1:47 0.00% osubw_sctpclien > > ... separate run... > > 963 penoff 1 122 0 2865M 3500K RUN 0:08 96.62% malloctest > > ----------------------------------------- > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > >