From owner-freebsd-stable@FreeBSD.ORG Wed Mar 27 01:26:03 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BF6F93BB for ; Wed, 27 Mar 2013 01:26:03 +0000 (UTC) (envelope-from janm@transactionware.com) Received: from mail3.transactionware.com (mail3.transactionware.com [202.68.173.211]) by mx1.freebsd.org (Postfix) with SMTP id 498C5349 for ; Wed, 27 Mar 2013 01:26:02 +0000 (UTC) Received: (qmail 71457 invoked by uid 907); 27 Mar 2013 01:19:20 -0000 Received: from Unknown (HELO jmmacpro.tmst.com.au) (202.68.173.218) (smtp-auth username janm, mechanism plain) by mail3.transactionware.com (qpsmtpd/0.84) with (AES128-SHA encrypted) ESMTPSA; Wed, 27 Mar 2013 12:19:20 +1100 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: FreeBSD 9.1 excessive memory allocations From: Jan Mikkelsen In-Reply-To: Date: Wed, 27 Mar 2013 12:19:18 +1100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <1364322902.78474.YahooMailNeo@web161904.mail.bf1.yahoo.com> <175E75EE-8E85-49A4-838B-D79CE96CC3C4@tony.li> To: Alexander Yerenkow X-Mailer: Apple Mail (2.1503) Cc: Tony Li , "freebsd-stable@freebsd.org" , Unga X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Mar 2013 01:26:03 -0000 On 27/03/2013, at 7:08 AM, Alexander Yerenkow = wrote: > 2013/3/26 Tony Li >=20 >>=20 >>> I have a heavily threaded C application, developed on an Intel Core = i5 >> laptop (2 cores) running FreeBSD 8.1-RELEASE. >>>=20 >>> When this application compile and run on another Intel Core i7 = laptop (4 >> cores) running FreeBSD 9.1-RELEASE, this application immediately = starts >> grabbing memory by over 100MB per second and soon exit with not = enough RAM. >>=20 >=20 > Sorry, can't remember exactly, but you could search current- or = stable- > for something like you got. > This related IIRC with changes in thread subsystem, so basically each > thread will consume now more mem. > Search for details, your description is ringing some bell :) Yes, I remember that too. I think that was linking with libc_r so there = was only one kernel thread in the earlier version, but linked with = -pthread only in 9-whatever leading to an explosion in the number of = kernel threads. Unga: Have you changed linker options? If so, you may have increased the = number of kernel threads, increasing memory requirements. You could = experiment with -lkse instead of -lc_r, and calling = pthread_set_concurrency(). To manage the number of kernel threads. I = haven't tried it, so best of luck. Regards, Jan.