From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Adrian Aichner Newsgroups: gmane.emacs.devel Subject: Re: GC Date: Sun, 26 Jun 2005 10:20:52 +0200 Organization: The XEmacs Project Message-ID: References: <200506182319.j5INJWF08937@raven.dms.auburn.edu> <874qbqh0lm.fsf@jurta.org> <87mzpf3a5v.fsf_-_@jurta.org> <87y88zv3vm.fsf@jurta.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1119774678 1756 80.91.229.2 (26 Jun 2005 08:31:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 26 Jun 2005 08:31:18 +0000 (UTC) Cc: Adrian Aichner , emacs-devel@gnu.org, miles@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 26 10:31:08 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DmSXg-0004nL-Qb for ged-emacs-devel@m.gmane.org; Sun, 26 Jun 2005 10:31:05 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DmSf4-000675-ET for ged-emacs-devel@m.gmane.org; Sun, 26 Jun 2005 04:38:43 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DmSWK-0002Ma-A7 for emacs-devel@gnu.org; Sun, 26 Jun 2005 04:29:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DmSUU-0000gC-Rc for emacs-devel@gnu.org; Sun, 26 Jun 2005 04:27:48 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DmSUS-0000Ax-Iw for emacs-devel@gnu.org; Sun, 26 Jun 2005 04:27:45 -0400 Original-Received: from [194.25.134.80] (helo=mailout01.sul.t-online.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DmSRz-0007km-Pt; Sun, 26 Jun 2005 04:25:12 -0400 Original-Received: from fwd33.aul.t-online.de by mailout01.sul.t-online.com with smtp id 1DmSNy-0006Jy-00; Sun, 26 Jun 2005 10:21:02 +0200 Original-Received: from TANG.t-online.de (Vr58iTZTQeU2KptodXGxo9N6ufa6SFN0TJyzGtWTgO+KjY+GOeAFZC@[84.153.97.160]) by fwd33.sul.t-online.de with esmtp id 1DmSNp-1KrDge0; Sun, 26 Jun 2005 10:20:53 +0200 Original-To: snogglethorpe@gmail.com X-Attribution: APA X-Face: 4[iHdXiTu\V3u[~\I)*}#kYF[-tYl3VZga/HSOP|K,{L Rtu@f0y/=O&Cu}\:~d|P$JON?pn?j,&CnPb1z#/TL9bkAJwyol&a:SvYj-VYbM=Dtxhk9 =w|R6U3_;SH&B (Miles Bader's message of "Sun, 26 Jun 2005 09:02:57 +0900") User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.5-b20 (cilantro, windows-nt) X-ID: Vr58iTZTQeU2KptodXGxo9N6ufa6SFN0TJyzGtWTgO+KjY+GOeAFZC@t-dialin.net X-TOI-MSGID: 9280a127-a2ea-428b-a733-4e72785d21fd X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:39548 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:39548 Miles Bader writes: > On 6/26/05, Adrian Aichner wrote: >> >> isn't that the purpose of >> >> gc-cons-percentage >> > >> > There is no such variable in Emacs. >>=20 >> Oh, so it's a XEmacs-only thing. > > OK; guess if we add this feature, we should use the same variable > name though. > > As Ga=EBtan Leurent pointed out, it's also a good idea to apply min/max > bounds to the calculated value, to handle extreme cases; what does > xemacs do about that? Oops, this feature not currently enabled in XEmacs! See recompute_need_to_garbage_collect in alloc.c. Here is its documentation from the trunk version of alloc.c anyway: DEFVAR_INT ("gc-cons-percentage", &gc_cons_percentage /* *Percentage of memory allocated between garbage collections. Garbage collection will happen if this percentage of the total amount of memory used for data has been allocated since the last garbage collection. However, it will not happen if less than `gc-cons-threshold' bytes have been allocated -- this sets an absolute minimum in case very little data has been allocated or the percentage is set very low. Set this to 0 to have garbage collection always happen after `gc-cons-threshold' bytes have been allocated, regardless of current memory usage. Garbage collection happens automatically when `eval' or `funcall' are called. (Note that `funcall' is called implicitly as part of evaluation.) By binding this temporarily to a large number, you can effectively prevent garbage collection during a part of the program. See also `consing-since-gc'. */ ); So, gc-cons-threshold serves as the lower bound, and gc-cons-percentage itself is the upper. Adrian > > [I'm thinking a minimum of say the current default (400K), and a max > of oh, 8MB.] > > -Miles --=20 Adrian Aichner mailto:adrian@xemacs.org http://www.xemacs.org/