From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.user Subject: Re: Memory leak with threads + guile 1.8.7 ? Date: Sat, 12 Feb 2011 15:20:05 +0100 Message-ID: References: <20100915134724.GA13622@securactive.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1297520125 9339 80.91.229.12 (12 Feb 2011 14:15:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 12 Feb 2011 14:15:25 +0000 (UTC) Cc: guile-user@gnu.org To: Cedric Cellier Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Feb 12 15:15:20 2011 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PoGFr-0006Kl-RV for guile-user@m.gmane.org; Sat, 12 Feb 2011 15:15:20 +0100 Original-Received: from localhost ([127.0.0.1]:38325 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PoGFr-0005IG-5j for guile-user@m.gmane.org; Sat, 12 Feb 2011 09:15:19 -0500 Original-Received: from [140.186.70.92] (port=47373 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PoGFZ-0005Hd-VY for guile-user@gnu.org; Sat, 12 Feb 2011 09:15:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PoGFY-0007YF-D7 for guile-user@gnu.org; Sat, 12 Feb 2011 09:15:01 -0500 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:59022 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PoGFX-0007Xh-VU for guile-user@gnu.org; Sat, 12 Feb 2011 09:15:00 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 60D6B3E70; Sat, 12 Feb 2011 09:16:01 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=ch1i7yF+0eLk+jU+WCRV+SGF82c=; b=kQJb8Y XBZO6Wm0s29XpEHjPj1df9VMqTM4FNvW1A0sph9pqfiajXFooSuqd76xFDcdHjPN 9TzRT8cpjhKsHRfG362rMmWQbeH6/cVVOLeZlHBh9lJDdJ28d4m5MLyBELWpxMkP G+sjIn8s5CJfxjRJSCVxQLtfHawgYLhd0jGRk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=qd1NwYqoQxAERoiDFZX0hWd8kqyO0vgv /UMOaYocng1l8MiNCs0lZen+ChJIhwyaE9XGoCdktVmPOSpBg7E5b69cGj4MKSIp SZ2WUSL1VW1u4k+wwL/rr2pKPjsXlWD8/IEqpcJ2CH9MOFC8qxzaLYlVZIZuZltZ Bt8WQPg7hr8= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 4A1023E6F; Sat, 12 Feb 2011 09:16:00 -0500 (EST) Original-Received: from unquote.localdomain (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 8D3D33E6E; Sat, 12 Feb 2011 09:15:58 -0500 (EST) In-Reply-To: <20100915134724.GA13622@securactive.net> (Cedric Cellier's message of "Wed, 15 Sep 2010 15:47:24 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: 9DEB199C-36B2-11E0-A4D3-AF401E47CF6F-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 64.74.157.62 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:8427 Archived-At: Hi Cedric, You posted a mail to the list some months ago: On Wed 15 Sep 2010 15:47, Cedric Cellier writes: > I'm using guile in an C program that spawn a lot of short lived > threads, each of which passing in guile mode (guile 1.8.7), and I'm > facing a memory leak even when the threads does nothing (ie. the > C function called by scm_with_guile consists only of a return NULL. > After some time, if I call a gc-stats I have many many segments of > 21Mb allocated, although gc-live-object-stats reports that almost > nothing is alive (acording to expectations). > > I am under the impression that some of these segments, created by a > now defunct thread, can not be reused by others. > > So I made a small program that continuously creates thread and run > a NOP scm_with_guile in it, and then join it (so that thre thread local > storage itself is not leaked). > > With the useless scm_with_guile call, this programm leaks memory > very quickly. Comment out the scm_with_guile call and there is no more > leak. > > What do you think ? It's a bug, but with interesting implications in 1.9. I have filed bug #32436 about this. Thanks for the test case, Andy -- http://wingolog.org/