From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 30 12:06:30 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BCAF0BA6 for ; Tue, 30 Oct 2012 12:06:30 +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 0514E8FC14 for ; Tue, 30 Oct 2012 12:06:29 +0000 (UTC) Received: (qmail 77570 invoked by uid 907); 30 Oct 2012 11:59:46 -0000 Received: from eth222.nsw.adsl.internode.on.net (HELO [192.168.1.75]) (150.101.196.221) (smtp-auth username janm, mechanism plain) by mail3.transactionware.com (qpsmtpd/0.84) with (AES128-SHA encrypted) ESMTPSA; Tue, 30 Oct 2012 22:59:46 +1100 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: Threaded 6.4 code compiled under 9.0 uses a lot more memory?.. From: Jan Mikkelsen In-Reply-To: Date: Tue, 30 Oct 2012 22:59:47 +1100 Content-Transfer-Encoding: quoted-printable Message-Id: <73635E29-D47C-4952-9958-1442970E7A4F@transactionware.com> References: To: Karl Pielorz X-Mailer: Apple Mail (2.1499) X-Mailman-Approved-At: Tue, 30 Oct 2012 12:24:44 +0000 Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 12:06:30 -0000 Hi, On 30/10/2012, at 10:12 PM, Karl Pielorz wrote: >=20 > Hi All, >=20 > Can anyone think of any quick pointers as to why some code originally = written under 6.4 amd64 - when re-compiled under 9.0-stable amd64 takes = up a *lot* more memory when running? >=20 > The code involved is a sendmail Milter, and a TCP server type program = (that runs up a large number of threads [~700] at startup). >=20 > Both were previously compiled with: >=20 > -O2 -pthread -lc_r >=20 > They're now compiled under 9.0-S with just: >=20 > -O2 -pthread libc_r is a user mode implementation of pthreads, so there is one actual = kernel thread with a stack. You now have ~700 kernel threads on startup. = Per-thread stack allocation will be different, and you could quite = easily explain differences that way. Regards, Jan.