From owner-freebsd-hackers@FreeBSD.ORG Sat May 22 13:57:20 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 32FDD16A4CE for ; Sat, 22 May 2004 13:57:20 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id CA27643D2D for ; Sat, 22 May 2004 13:57:19 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i4MKup8Q026435; Sat, 22 May 2004 16:56:52 -0400 (EDT) Date: Sat, 22 May 2004 16:56:51 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Cole In-Reply-To: <000701c44034$89dbffb0$4206000a@stalker> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: Pthread_create and memory issues. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2004 20:57:20 -0000 On Sat, 22 May 2004, Cole wrote: > Hi > > Ok this is just a more direct question that the thread Memory Leak. > > I have a program using pthread_create, and it runs fine, no compile errors > or warnings, it all works fine, not a single issue, but it very very slowly > uses up memory. The program creates a fixed number of threads, and after > each one has run to completion it stores them for a while for use again if > needed soon, else it destroys them after a specified amount of time. The threads library (at least libpthread) caches threads and KSE/KSEGs for re-use. Threads also have to be detached (or joined to) in order to reclaim their space. -- Dan Eischen