From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.devel Subject: Re: Larger GC thresholds for non-interactive Emacs Date: Sat, 25 Jun 2022 13:13:22 +0800 Message-ID: <875ykpwcjx.fsf@localhost> References: <83o7yyur0l.fsf@gnu.org> <87leu2p3nu.fsf@localhost> <83leu2uewn.fsf@gnu.org> <87r13qv701.fsf@localhost> <83bkuursya.fsf@gnu.org> <87h74l9jk8.fsf@localhost> <83bkutqb3z.fsf@gnu.org> <9778F176-E724-4E61-B0FB-327BCDD316C0@acm.org> <87sfo4epeo.fsf@localhost> <87bkurrc5e.fsf@localhost> <87bkur72b7.fsf@gnus.org> <874k0j40e7.fsf@gnus.org> <874k0hxb0g.fsf@localhost> <87wndb34qj.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21098"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , Mattias =?utf-8?Q?Engdeg=C3=A5rd?= , Eli Zaretskii , Tim Cross , rms@gnu.org, Alan Mackenzie , emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jun 25 07:12:57 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o4y6L-0005JT-4b for ged-emacs-devel@m.gmane-mx.org; Sat, 25 Jun 2022 07:12:57 +0200 Original-Received: from localhost ([::1]:52780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o4y6J-0005VJ-Ik for ged-emacs-devel@m.gmane-mx.org; Sat, 25 Jun 2022 01:12:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39276) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o4y5g-0004qC-63 for emacs-devel@gnu.org; Sat, 25 Jun 2022 01:12:16 -0400 Original-Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]:33381) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o4y5d-0007TD-0I; Sat, 25 Jun 2022 01:12:15 -0400 Original-Received: by mail-pg1-x529.google.com with SMTP id z14so4241808pgh.0; Fri, 24 Jun 2022 22:12:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=PM70un3Lr3HGZOk7us+UVvpkF0FLgvHCKILrSbFzPKk=; b=YIjasBxOmNMHJsXLaZdyLwo+9RcfpWPihhUgKE7Z9h9wD4rz3Y+9j8raqAUlMD30ws 3aSzynbTpcyx8Mxpda62UoChUF69baKhfRsITtSm+BPlRLFDEWEhtUeRi3m5I4pj88pk JOnlxmZwXhmY60nh4b5j3fZIGva7cNcvdstki7ahlxGdlmRob5uH3o/lz8+fBDeWnJjV 6a4dHQ8fg7KtJEqGsSlyJuDENta3OUvWSjztG2blsBA0yYyo3uIF0gmyFy4DdXUWduxI 4K8uycvJL8ve/jHwu0XXj/TCKh6EFafwFQoGtohudBJK8ZSUFimzI+CovI/W/f8oCMUR oN3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=PM70un3Lr3HGZOk7us+UVvpkF0FLgvHCKILrSbFzPKk=; b=laI6V3zauBpvOjMIZxGqvseK9E/TT5dCjtq6+n2EMgA9dqw/ARWotP4eS6kHFC92nE f/TXZ5gXdjeMW4jt/zUYDwRN4ASEE1RrkT/n3n0twKe8kne50QuZukFGBfqrcpr9pFDW rfTZipD9SXVI38bUkgudzVKM0QrtxnX2MxfT3WBAORb9U0enLr84emPao9lKSuyiWM93 afMEO3bUoa3KqxssMYBoS3tdyPPKvIOFmxomhTLFwclI0Tvz7s8gtxRPXxqVO9v3JBih 1KGBtxCarsmvIejts7kPJPwXErQu/+CzZA7LTGKB36kXplnZMup1BjDp/yNBOxH5wRSG uV9w== X-Gm-Message-State: AJIora+9NB0MigM5XlQbVbuxvrZuZ4YUEXg7fNUUIG7vjuLutiDuHTLa mmJBhZnmWTDmqCGrq4Ad+sM= X-Google-Smtp-Source: AGRyM1v+t3niLI2O7sYfO4kbBmaUuWcc7tCv/oN4E+ejh8U5OJDfCd6znYJZSpN3MKi0LHzCh5yQxw== X-Received: by 2002:a63:ba07:0:b0:40d:77fd:9429 with SMTP id k7-20020a63ba07000000b0040d77fd9429mr2261184pgf.110.1656133930921; Fri, 24 Jun 2022 22:12:10 -0700 (PDT) Original-Received: from localhost ([192.161.177.252]) by smtp.gmail.com with ESMTPSA id e17-20020a170902d39100b0016a3db5d608sm2679558pld.289.2022.06.24.22.12.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jun 2022 22:12:10 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::529; envelope-from=yantar92@gmail.com; helo=mail-pg1-x529.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:291578 Archived-At: Stefan Monnier writes: >>> The difference between the two cases is that when you have half of the >>> heap made up of dead objects, there's a higher probability that some of >>> those objects are clustered such that they make up a few complete >>> 16kB blocks, whereas when only the dead objects represent only 10% of >>> the heap, almost all 16kB blocks will contain a mis of dead and live >>> objects and hence can't be returned to the malloc library. >> >> I am again confused. >> Does what you say imply that frequent GC with small threshold is not >> good because it will have less dead objects and have higher chance of >> fragmentation? > > Not at all. The general rule of thumb is: the sooner you recover free > space, the better you can avoid fragmentation. Sure. But how does the probability to get fragmentation scale with the GC threshold? Is it linear scaling or is it nonlinear (I suspect that it is non-linear)? Can someone quantify it? If we do, it would help to adjust the thresholds more optimally to balance between GC time and fragmentation. Best, Ihor