From owner-freebsd-questions@FreeBSD.ORG Wed May 20 21:30:38 2009 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 372E01065673 for ; Wed, 20 May 2009 21:30:38 +0000 (UTC) (envelope-from psteele@maxiscale.com) Received: from exprod7og107.obsmtp.com (exprod7og107.obsmtp.com [64.18.2.167]) by mx1.freebsd.org (Postfix) with SMTP id E79BD8FC17 for ; Wed, 20 May 2009 21:30:37 +0000 (UTC) (envelope-from psteele@maxiscale.com) Received: from source ([209.85.222.199]) by exprod7ob107.postini.com ([64.18.6.12]) with SMTP ID DSNKShR2fWQCGqxAzDwK1XFkwvDr3P6hWZzn@postini.com; Wed, 20 May 2009 14:30:38 PDT Received: by mail-pz0-f199.google.com with SMTP id 37so553250pzk.32 for ; Wed, 20 May 2009 14:30:33 -0700 (PDT) Received: by 10.114.154.1 with SMTP id b1mr3533809wae.77.1242855033144; Wed, 20 May 2009 14:30:33 -0700 (PDT) Received: from localhost ([76.231.178.131]) by mx.google.com with ESMTPS id v9sm3975908wah.36.2009.05.20.14.30.31 (version=SSLv3 cipher=RC4-MD5); Wed, 20 May 2009 14:30:32 -0700 (PDT) Date: Wed, 20 May 2009 14:30:28 -0700 (PDT) From: Peter Steele To: Dan Nelson Message-ID: <17114051.1791242855025561.JavaMail.HALO$@halo> In-Reply-To: <20090520210906.GH52703@dan.emsphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: #freebsd-questions Subject: Re: pthread_detach doesn't release memory 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, 20 May 2009 21:30:38 -0000 >If I add a loop to your main() function, and add your missing >pthread_detach() call, here's the memory usage I see on each iteration: That was a typo in my posting. I in fact did use pthread_detach; the line got deleted as I was composing my email. >So it reached a steady state after 5 loops. That was my problem. I only tested for 3 or 4 iterations; I should have when a few more times and I would have observed this steady. I just verified this with my own app. Thanks for helping me solve this mystery...