From owner-freebsd-hackers@FreeBSD.ORG Tue May 12 06:27:35 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DDAD106566C for ; Tue, 12 May 2009 06:27:35 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-ew0-f207.google.com (mail-ew0-f207.google.com [209.85.219.207]) by mx1.freebsd.org (Postfix) with ESMTP id 95C5C8FC1F for ; Tue, 12 May 2009 06:27:34 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: by ewy3 with SMTP id 3so3945420ewy.43 for ; Mon, 11 May 2009 23:27:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:to:subject:organization:from :date:message-id:user-agent:mime-version:content-type; bh=2K1mssUc37Rx+3Tr2D8wq9uu2Nc5NozJYg/7OaZAKWc=; b=v1uGnzMGuYpuJ76vkQKwp3MRKYApBmM13wYwwxAY8DPPRTZQrw4qiDUD6DDFohoL64 Vj3O3eD690zsYWtazK8KqLuvmLK0JrfpjlcSm64+nI12eiRKynofi3yyRj/MHtQT1Djh ToJgcCj4F2EvGyM7PZ2CQgSQY5VgHAZ8kR+9w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=to:subject:organization:from:date:message-id:user-agent :mime-version:content-type; b=mAusIMAAqD96/GkV3UMY6+esvs0FCZa8C1WhdPhvKbf4nzLmllG16kTbsm3ovzOpFO yt+vpLduJZ8rO79pAhjqy3pWEjMLwAHjUe6KSUBQmURg/86R/vfxC/i//0qW7D9zw7cV HcRddwJrarvDsGqqOoHdVjcGrR+v7n497LcMQ= Received: by 10.210.19.7 with SMTP id 7mr6235350ebs.37.1242109653621; Mon, 11 May 2009 23:27:33 -0700 (PDT) Received: from localhost (ms.singlescrowd.net [80.85.90.67]) by mx.google.com with ESMTPS id 23sm2933328eya.19.2009.05.11.23.27.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 11 May 2009 23:27:33 -0700 (PDT) To: freebsd-hackers@freebsd.org Organization: TOA Ukraine From: Mikolaj Golub Date: Tue, 12 May 2009 09:27:30 +0300 Message-ID: <814ovqn8dp.fsf@zhuzha.ua1> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Memory leak on thread removal X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2009 06:27:35 -0000 Hi, The code below is compiled with -fopenmp and run on FreeBSD6/7 (i386, amd64): #include #include int n = 4, m = 2; int main () { for (;;) { int i; //sleep(2); #pragma omp parallel for num_threads(m) for(i = 0; i < 1; i++) {} //sleep(2); #pragma omp parallel for num_threads(n) for(i = 0; i < 1; i++) {} } return 0; } During the run the program's virtual memory usage constantly grows. The growth is observed only when n != m. When running the program with uncommented sleep() and observing the number of threads with 'top -H' I see in turn 2 or 4 threads. So it looks like memory leak when thread is removed. Should I fill PR? -- Mikolaj Golub