From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id ML4mCXr6XGNuZAEAbAwnHQ (envelope-from ) for ; Sat, 29 Oct 2022 12:03:38 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id AMAtCHr6XGMhRwAAG6o9tA (envelope-from ) for ; Sat, 29 Oct 2022 12:03:38 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id EF0B8261F2 for ; Sat, 29 Oct 2022 12:03:36 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ooigC-0006ph-Bu; Sat, 29 Oct 2022 06:03:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ooigA-0006pY-Lh for bug-guix@gnu.org; Sat, 29 Oct 2022 06:03:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ooigA-0001HV-Df for bug-guix@gnu.org; Sat, 29 Oct 2022 06:03:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ooig9-0001iA-Vo for bug-guix@gnu.org; Sat, 29 Oct 2022 06:03:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#58631: [Shepherd] Indefinite heap growth (memory leak) Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 29 Oct 2022 10:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58631 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 58631@debbugs.gnu.org Received: via spool by 58631-submit@debbugs.gnu.org id=B58631.16670377316519 (code B ref 58631); Sat, 29 Oct 2022 10:03:01 +0000 Received: (at 58631) by debbugs.gnu.org; 29 Oct 2022 10:02:11 +0000 Received: from localhost ([127.0.0.1]:34994 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooifK-0001h4-J2 for submit@debbugs.gnu.org; Sat, 29 Oct 2022 06:02:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54932) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooifG-0001gY-3i for 58631@debbugs.gnu.org; Sat, 29 Oct 2022 06:02:09 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ooifA-0001A7-KU for 58631@debbugs.gnu.org; Sat, 29 Oct 2022 06:02:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=4wA/2kDqKcd5n9Z5ClqTjQ1gYbPxl5XyOkNOzstR/B8=; b=mJhg7K7oeydOnwDGUFYf 3DivcG7chOB/5q9F+ObNr1NfNyBGvwXJoQj8Y219YrmQkdsh1KHSfQBzzXfAKmQLSBoHyUlM4oFxD ifwiwYZCjTZmJYiOOtAaHDjdMz9clwcvx0EQwf5jhvOujUdDgKVvI8KmKLae5fjFtJuAGuHq+mZOU wUpuJlXYV5+iHZB1Raw3n8uVfTH+aasRFdgi47syaMEi4+EBFf64dGx1NrctJwQVk1etSOg0b//k4 nXu+VOGyLP8udJLNJEjl1HWZJVUB/5b/WnRchbnxxzPiRTwtPvl1JlVBzXaYFHxKBoyyw8AUBZilX nXThMDB8cvOdGQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ooif9-0000Bt-Kz for 58631@debbugs.gnu.org; Sat, 29 Oct 2022 06:01:59 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87pmeohute.fsf@gnu.org> <87sfjjhjcd.fsf@gnu.org> <87a65qhmh3.fsf@gnu.org> <87ilkb4n5l.fsf_-_@gnu.org> Date: Sat, 29 Oct 2022 12:01:57 +0200 In-Reply-To: <87ilkb4n5l.fsf_-_@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Sat, 22 Oct 2022 22:29:58 +0200") Message-ID: <87r0yrymlm.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "bug-Guix" Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org X-TUID: 8Wh21poQCDNv --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable The attached Fibers program illustrates the problem: heap grows even though it=E2=80=99s not supposed to. Ludo=E2=80=99. --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=fibers-memory-consumption.scm Content-Description: the program ;; https://issues.guix.gnu.org/58631 (use-modules (fibers) (fibers channels) (ice-9 rdelim) (statprof)) (run-fibers (lambda () (define channel (make-channel)) (define leave-channel (make-channel)) (spawn-fiber (lambda () (sleep 10) (put-message leave-channel 'leave))) (spawn-fiber (lambda () (let loop () (put-message channel 'hi!) (get-message channel) (loop)))) (spawn-fiber (lambda () (let loop () (get-message channel) (put-message channel 'hey!) (loop)))) (spawn-fiber (lambda () (let loop () (pk 'heap-size (assoc-ref (gc-stats) 'heap-size)) (sleep 2) (loop)))) (get-message leave-channel)) ;; #:drain? #t #:parallelism 1 ;don't create POSIX threads #:hz 0) --=-=-=--