From unknown Sun Jun 22 11:49:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#31852: Make memory-limit obsolete Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Jun 2018 01:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 31852 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 31852@debbugs.gnu.org X-Debbugs-Original-To: Emacs bug reports Received: via spool by submit@debbugs.gnu.org id=B.15291128501387 (code B ref -1); Sat, 16 Jun 2018 01:35:01 +0000 Received: (at submit) by debbugs.gnu.org; 16 Jun 2018 01:34:10 +0000 Received: from localhost ([127.0.0.1]:50748 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fU06S-0000MH-Ej for submit@debbugs.gnu.org; Fri, 15 Jun 2018 21:34:10 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60037) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fU06Q-0000Ll-9A for submit@debbugs.gnu.org; Fri, 15 Jun 2018 21:34:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fU06J-0003BJ-Ec for submit@debbugs.gnu.org; Fri, 15 Jun 2018 21:34:01 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:48192) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fU06J-0003B2-9L for submit@debbugs.gnu.org; Fri, 15 Jun 2018 21:33:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fU06F-00030z-NH for bug-gnu-emacs@gnu.org; Fri, 15 Jun 2018 21:33:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fU06C-00030a-IQ for bug-gnu-emacs@gnu.org; Fri, 15 Jun 2018 21:33:55 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:50158) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fU06C-0002wl-6S for bug-gnu-emacs@gnu.org; Fri, 15 Jun 2018 21:33:52 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 0383616087B for ; Fri, 15 Jun 2018 18:33:49 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id dhOiKG05qMdT for ; Fri, 15 Jun 2018 18:33:47 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id D02CB16099B for ; Fri, 15 Jun 2018 18:33:47 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id szDvIe_5LXtS for ; Fri, 15 Jun 2018 18:33:47 -0700 (PDT) Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id B019A16087B for ; Fri, 15 Jun 2018 18:33:47 -0700 (PDT) From: Paul Eggert Openpgp: preference=signencrypt Autocrypt: addr=eggert@cs.ucla.edu; prefer-encrypt=mutual; keydata= xsFNBEyAcmQBEADAAyH2xoTu7ppG5D3a8FMZEon74dCvc4+q1XA2J2tBy2pwaTqfhpxxdGA9 Jj50UJ3PD4bSUEgN8tLZ0san47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QCGwwFCRLMAwAACgkQ7ZfpDmKqfjSrHA/+KzAKvTxRhA9MWNLxIyJ7S5uJ16gs T3oCjZrBKGEhKMOGX4O0GA6VOEryO7QRCCYah3oxSG38IAnNeiwJXgU9Bzkk85UGbPEd7HGF /VSeHCQwWou6jqUDTSDvn9YhNTdG0KXPM74aC+xr2Zow1O2mhXihgWKD0Dw+0LYPnUOsQ0KO FxHXXYHmRrS1OZPU59BLvc+TRhIhafSHKLwbXK+6ckkxBx6h8z5ccpG0Qs4bFhdFYnFrEieD LoGmnE2YLhdV6swJ9VNCS6pLiEohT3fm7aXm15tZOIyzMZhHRSAPblXxQ0ZSWjq8oRrcYNFx c4W1URpAkBCOYJoXvQfD5L3lqAl8TCqDUzYxhH/tJhbDdHrqHH767jaDaTB1+Talp/2AMKwc XNOdiklGxbmHVG6YGl6g8Lrbsu9NZEI4yLlHzuikthJWgz+3vZhVGyNlt+HNIoF6CjDL2omu 5cEq4RDHM44QqPk6l7O0pUvN1mT4B+S1b08RKpqm/ff015E37HNV/piIvJlxGAYz8PSfuGCB 1thMYqlmgdhd9/BabGFbGGYHA6U4/T5zqU+f6xHy1SsAQZ1MSKlLwekBIT+4/cLRGqCHjnV0 q5H/T6a7t5mPkbzSrOLSo4puj+IToNjYyYIDBWzhlA19avOa+rvUjmHtD3sFN7cXWtkGoi8b uNcby4U= Organization: UCLA Computer Science Department Message-ID: <510fa6e2-38e5-f5cf-e1c8-4a1a553a162d@cs.ucla.edu> Date: Fri, 15 Jun 2018 18:33:47 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------200693BE6EBF92F49695F538" Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) This is a multi-part message in MIME format. --------------200693BE6EBF92F49695F538 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Tags: patch The memory-limit function has an implementation that is a relic of long-ago days when the heap was allocated via sbrk. This assumption is often no longer true now that ASLR is popular, and once we get portable dumping work it'll be true even less often. Since memory-limit returns nonsense so often and since nobody cares, we can and should mark memory-limit as obsolete. On its way out we can move it to a Lisp implementation and cause it to be at least somewhat more plausible. Proposed patches attached. The first patch moves memory-limit to Lisp, the second one marks it obsolete. I didn't know where to put the Lisp implementation so I put it into lisp/subr.el. --------------200693BE6EBF92F49695F538 Content-Type: text/x-patch; name="0001-Rewrite-memory-limit-in-Lisp.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Rewrite-memory-limit-in-Lisp.patch" >From 52f4585c1353c3c12079bc7bfe85ef44755134db Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 15 Jun 2018 18:05:28 -0700 Subject: [PATCH 1/2] Rewrite memory-limit in Lisp Have it return Emacs virtual memory size, not the sbrk value which is often useless newadays. * doc/lispref/internals.texi (Garbage Collection): * etc/NEWS: Document this. * lisp/subr.el (memory-limit): New implementation in Lisp, written in terms of process-attributes, and which returns virtual memory size. * src/alloc.c (Fmemory_limit): Remove C implementation. --- doc/lispref/internals.texi | 6 ++---- etc/NEWS | 3 +++ lisp/subr.el | 4 ++++ src/alloc.c | 19 ------------------- 4 files changed, 9 insertions(+), 23 deletions(-) diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index 9cf1a4f9a3..faaf26f4f7 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi @@ -507,10 +507,8 @@ Garbage Collection memory Emacs is currently using. @defun memory-limit -This function returns the address of the last byte Emacs has allocated, -divided by 1024. We divide the value by 1024 to make sure it fits in a -Lisp integer. - +This function returns an estimate of the total amount of bytes of +virtual memory that Emacs is currently using, divided by 1024. You can use this to get a general idea of how your actions affect the memory usage. @end defun diff --git a/etc/NEWS b/etc/NEWS index e89402db13..30409a89b5 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -656,6 +656,9 @@ socket has been passed to Emacs (Bug#24218). instead of just Microsoft platforms. This fixes a 'get-free-disk-space' bug on OS X 10.8 and later (Bug#28639). ++++ +** 'memory-limit' now returns a better estimate of memory consumption. + +++ ** New macro 'combine-change-calls' arranges to call the change hooks ('before-change-functions' and 'after-change-functions') just once diff --git a/lisp/subr.el b/lisp/subr.el index 914112ccef..e4da2b2075 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2182,6 +2182,10 @@ process-put (set-process-plist process (plist-put (process-plist process) propname value))) +(defun memory-limit () + "Return an estimate of Emacs virtual memory usage, divided by 1024." + (or (cdr (assq 'vsize (process-attributes (emacs-pid)))) 0)) + ;;;; Input and display facilities. diff --git a/src/alloc.c b/src/alloc.c index 7b2140501e..52620a54ac 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -7120,24 +7120,6 @@ or memory information can't be obtained, return nil. */) /* Debugging aids. */ -DEFUN ("memory-limit", Fmemory_limit, Smemory_limit, 0, 0, 0, - doc: /* Return the address of the last byte Emacs has allocated, divided by 1024. -This may be helpful in debugging Emacs's memory usage. -We divide the value by 1024 to make sure it fits in a Lisp integer. */) - (void) -{ - Lisp_Object end; - -#if defined HAVE_NS || defined __APPLE__ || !HAVE_SBRK - /* Avoid warning. sbrk has no relation to memory allocated anyway. */ - XSETINT (end, 0); -#else - XSETINT (end, (intptr_t) (char *) sbrk (0) / 1024); -#endif - - return end; -} - DEFUN ("memory-use-counts", Fmemory_use_counts, Smemory_use_counts, 0, 0, 0, doc: /* Return a list of counters that measure how much consing there has been. Each of these counters increments for a certain kind of object. @@ -7495,7 +7477,6 @@ The time is in seconds as a floating point value. */); defsubr (&Smake_finalizer); defsubr (&Spurecopy); defsubr (&Sgarbage_collect); - defsubr (&Smemory_limit); defsubr (&Smemory_info); defsubr (&Smemory_use_counts); defsubr (&Ssuspicious_object); -- 2.17.1 --------------200693BE6EBF92F49695F538 Content-Type: text/x-patch; name="0002-Obsolete-memory-limit.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0002-Obsolete-memory-limit.patch" >From 5645d547959780e21fe7c5eff12a0d0ae22702da Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 15 Jun 2018 18:21:10 -0700 Subject: [PATCH 2/2] Obsolete memory-limit * doc/lispref/internals.texi (Garbage Collection): Remove documentation of memory-limit. * etc/NEWS: Say it's obsolete. * lisp/subr.el (memory-limit): Declare that it's obsolete. --- doc/lispref/internals.texi | 7 ------- etc/NEWS | 3 ++- lisp/subr.el | 1 + 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index faaf26f4f7..e8fe26856c 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi @@ -506,13 +506,6 @@ Garbage Collection function @code{memory-limit} provides information on the total amount of memory Emacs is currently using. -@defun memory-limit -This function returns an estimate of the total amount of bytes of -virtual memory that Emacs is currently using, divided by 1024. -You can use this to get a general idea of how your actions affect the -memory usage. -@end defun - @defvar memory-full This variable is @code{t} if Emacs is nearly out of memory for Lisp objects, and @code{nil} otherwise. diff --git a/etc/NEWS b/etc/NEWS index 30409a89b5..a1f853e8cd 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -657,7 +657,8 @@ instead of just Microsoft platforms. This fixes a 'get-free-disk-space' bug on OS X 10.8 and later (Bug#28639). +++ -** 'memory-limit' now returns a better estimate of memory consumption. +** The 'memory-limit' function is now obsolete. You can use +the 'vsize' component of (process-attributes (emacs-pid)) instead. +++ ** New macro 'combine-change-calls' arranges to call the change hooks diff --git a/lisp/subr.el b/lisp/subr.el index e4da2b2075..6af32c95bc 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2184,6 +2184,7 @@ process-put (defun memory-limit () "Return an estimate of Emacs virtual memory usage, divided by 1024." + (declare (obsolete process-attributes "27.1")) (or (cdr (assq 'vsize (process-attributes (emacs-pid)))) 0)) -- 2.17.1 --------------200693BE6EBF92F49695F538-- From unknown Sun Jun 22 11:49:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#31852: Make memory-limit obsolete Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Jun 2018 06:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31852 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Paul Eggert Cc: 31852@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 31852-submit@debbugs.gnu.org id=B31852.15291307043161 (code B ref 31852); Sat, 16 Jun 2018 06:32:01 +0000 Received: (at 31852) by debbugs.gnu.org; 16 Jun 2018 06:31:44 +0000 Received: from localhost ([127.0.0.1]:50876 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fU4kS-0000ov-MO for submit@debbugs.gnu.org; Sat, 16 Jun 2018 02:31:44 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58968) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fU4kR-0000oi-3P for 31852@debbugs.gnu.org; Sat, 16 Jun 2018 02:31:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fU4kH-00077T-WE for 31852@debbugs.gnu.org; Sat, 16 Jun 2018 02:31:38 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33190) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fU4kH-000779-Sh; Sat, 16 Jun 2018 02:31:33 -0400 Received: from [176.228.60.248] (port=2794 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fU4kG-0005PE-Ty; Sat, 16 Jun 2018 02:31:33 -0400 Date: Sat, 16 Jun 2018 09:31:23 +0300 Message-Id: <83in6j1bus.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <510fa6e2-38e5-f5cf-e1c8-4a1a553a162d@cs.ucla.edu> (message from Paul Eggert on Fri, 15 Jun 2018 18:33:47 -0700) References: <510fa6e2-38e5-f5cf-e1c8-4a1a553a162d@cs.ucla.edu> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Paul Eggert > Date: Fri, 15 Jun 2018 18:33:47 -0700 > > The memory-limit function has an implementation that is a relic of > long-ago days when the heap was allocated via sbrk. This assumption is > often no longer true now that ASLR is popular, and once we get portable > dumping work it'll be true even less often. Since memory-limit returns > nonsense so often and since nobody cares, we can and should mark > memory-limit as obsolete. On its way out we can move it to a Lisp > implementation and cause it to be at least somewhat more plausible. > > Proposed patches attached. The first patch moves memory-limit to Lisp, > the second one marks it obsolete. I didn't know where to put the Lisp > implementation so I put it into lisp/subr.el. I don't have anything against moving this to Lisp (provided that all the platforms we care about have a non-trivial implementation of process-attributes), but I don't understand what we gain by declaring this tiny function obsolete, especially since the alternative proposed in the warning is exactly what's used in the proposed Lisp implementation. Wouldn't it be enough just to add to the function's documentation a note that the estimation should be expected to be inaccurate with modern memory-management technologies? Thanks. From unknown Sun Jun 22 11:49:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#31852: Make memory-limit obsolete Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Jun 2018 13:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31852 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: 31852@debbugs.gnu.org Received: via spool by 31852-submit@debbugs.gnu.org id=B31852.152915635432518 (code B ref 31852); Sat, 16 Jun 2018 13:40:02 +0000 Received: (at 31852) by debbugs.gnu.org; 16 Jun 2018 13:39:14 +0000 Received: from localhost ([127.0.0.1]:51121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fUBQ8-0008SO-8b for submit@debbugs.gnu.org; Sat, 16 Jun 2018 09:39:14 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:34370) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fUBQ5-0008S8-CL for 31852@debbugs.gnu.org; Sat, 16 Jun 2018 09:39:10 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 697A9160564; Sat, 16 Jun 2018 06:39:03 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id RSRjuMSprJLW; Sat, 16 Jun 2018 06:39:02 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 8808D160597; Sat, 16 Jun 2018 06:39:02 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id C7Ob5F1v2adq; Sat, 16 Jun 2018 06:39:02 -0700 (PDT) Received: from [192.168.1.9] (unknown [47.154.30.119]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 29CAE160564; Sat, 16 Jun 2018 06:39:02 -0700 (PDT) References: <510fa6e2-38e5-f5cf-e1c8-4a1a553a162d@cs.ucla.edu> <83in6j1bus.fsf@gnu.org> From: Paul Eggert Openpgp: preference=signencrypt Autocrypt: addr=eggert@cs.ucla.edu; prefer-encrypt=mutual; keydata= xsFNBEyAcmQBEADAAyH2xoTu7ppG5D3a8FMZEon74dCvc4+q1XA2J2tBy2pwaTqfhpxxdGA9 Jj50UJ3PD4bSUEgN8tLZ0san47l5XTAFLi2456ciSl5m8sKaHlGdt9XmAAtmXqeZVIYX/UFS 96fDzf4xhEmm/y7LbYEPQdUdxu47xA5KhTYp5bltF3WYDz1Ygd7gx07Auwp7iw7eNvnoDTAl KAl8KYDZzbDNCQGEbpY3efZIvPdeI+FWQN4W+kghy+P6au6PrIIhYraeua7XDdb2LS1en3Ss mE3QjqfRqI/A2ue8JMwsvXe/WK38Ezs6x74iTaqI3AFH6ilAhDqpMnd/msSESNFt76DiO1ZK QMr9amVPknjfPmJISqdhgB1DlEdw34sROf6V8mZw0xfqT6PKE46LcFefzs0kbg4GORf8vjG2 Sf1tk5eU8MBiyN/bZ03bKNjNYMpODDQQwuP84kYLkX2wBxxMAhBxwbDVZudzxDZJ1C2VXujC OJVxq2kljBM9ETYuUGqd75AW2LXrLw6+MuIsHFAYAgRr7+KcwDgBAfwhPBYX34nSSiHlmLC+ KaHLeCLF5ZI2vKm3HEeCTtlOg7xZEONgwzL+fdKo+D6SoC8RRxJKs8a3sVfI4t6CnrQzvJbB n6gxdgCu5i29J1QCYrCYvql2UyFPAK+do99/1jOXT4m2836j1wARAQABzSBQYXVsIEVnZ2Vy dCA8ZWdnZXJ0QGNzLnVjbGEuZWR1PsLBfgQTAQIAKAUC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LSo4puj+IToNjYyYIDBWzhlA19avOa+rvUjmHtD3sFN7cXWtkGoi8b uNcby4U= Organization: UCLA Computer Science Department Message-ID: <36f43145-ab73-d6e4-ae70-4d801bfe7583@cs.ucla.edu> Date: Sat, 16 Jun 2018 06:38:55 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <83in6j1bus.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii wrote: > I don't understand what we gain by declaring > this tiny function obsolete Nobody uses the function (clearly, since it doesn't work) so we gain simp= licity,=20 which is a win. > Wouldn't it be enough just to add to the function's > documentation a note that the estimation should be expected to be > inaccurate with modern memory-management technologies? Complicating the documentation would work against the goal of simplicity.= If the=20 goal is something other than simplicity, it'd be helpful to know what the= goal=20 is before proposing a different patch 2. The idea behind patch 2 is that=20 simplicity trumps compatibility here, as nobody uses the function and nob= ody=20 will use it even if patch 1 is applied, partly because of the inaccuracie= s that=20 you mention. From unknown Sun Jun 22 11:49:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#31852: Make memory-limit obsolete Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Jun 2018 15:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31852 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Paul Eggert Cc: 31852@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 31852-submit@debbugs.gnu.org id=B31852.152916134316002 (code B ref 31852); Sat, 16 Jun 2018 15:03:01 +0000 Received: (at 31852) by debbugs.gnu.org; 16 Jun 2018 15:02:23 +0000 Received: from localhost ([127.0.0.1]:51778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fUCid-0004A2-5H for submit@debbugs.gnu.org; Sat, 16 Jun 2018 11:02:23 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38858) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fUCib-00049n-Dw for 31852@debbugs.gnu.org; Sat, 16 Jun 2018 11:02:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fUCiS-0000zG-W1 for 31852@debbugs.gnu.org; Sat, 16 Jun 2018 11:02:16 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37444) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUCiS-0000z7-S9; Sat, 16 Jun 2018 11:02:12 -0400 Received: from [176.228.60.248] (port=3728 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fUCiS-0006kZ-Dl; Sat, 16 Jun 2018 11:02:12 -0400 Date: Sat, 16 Jun 2018 18:02:03 +0300 Message-Id: <83o9gazses.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <36f43145-ab73-d6e4-ae70-4d801bfe7583@cs.ucla.edu> (message from Paul Eggert on Sat, 16 Jun 2018 06:38:55 -0700) References: <510fa6e2-38e5-f5cf-e1c8-4a1a553a162d@cs.ucla.edu> <83in6j1bus.fsf@gnu.org> <36f43145-ab73-d6e4-ae70-4d801bfe7583@cs.ucla.edu> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > Cc: 31852@debbugs.gnu.org > From: Paul Eggert > Date: Sat, 16 Jun 2018 06:38:55 -0700 > > Eli Zaretskii wrote: > > I don't understand what we gain by declaring > > this tiny function obsolete > > Nobody uses the function (clearly, since it doesn't work) so we gain simplicity, > which is a win. If nobody uses the function, I see no gain at all, because obsoleting a function tells those who use it not to. > > Wouldn't it be enough just to add to the function's > > documentation a note that the estimation should be expected to be > > inaccurate with modern memory-management technologies? > > Complicating the documentation would work against the goal of > simplicity. Then let's just move this to Lisp, and do nothing else. That's even simpler, IMO. From unknown Sun Jun 22 11:49:28 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Paul Eggert Subject: bug#31852: closed (Re: bug#31852: Make memory-limit obsolete) Message-ID: References: <510fa6e2-38e5-f5cf-e1c8-4a1a553a162d@cs.ucla.edu> X-Gnu-PR-Message: they-closed 31852 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 31852@debbugs.gnu.org Date: Sat, 16 Jun 2018 15:36:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1529163363-19147-1" This is a multi-part message in MIME format... ------------=_1529163363-19147-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #31852: Make memory-limit obsolete which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 31852@debbugs.gnu.org. --=20 31852: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D31852 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1529163363-19147-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 31852-done) by debbugs.gnu.org; 16 Jun 2018 15:35:02 +0000 Received: from localhost ([127.0.0.1]:51830 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fUDED-0004xL-GU for submit@debbugs.gnu.org; Sat, 16 Jun 2018 11:35:01 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:45810) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fUDEC-0004wz-0x for 31852-done@debbugs.gnu.org; Sat, 16 Jun 2018 11:35:00 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 6DC6A160653; Sat, 16 Jun 2018 08:34:54 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id tTz7VMtSy0hu; Sat, 16 Jun 2018 08:34:53 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id A72C5160657; Sat, 16 Jun 2018 08:34:53 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id dWeQNBw2Yof7; Sat, 16 Jun 2018 08:34:53 -0700 (PDT) Received: from [192.168.1.9] (unknown [47.154.30.119]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 650B5160653; Sat, 16 Jun 2018 08:34:53 -0700 (PDT) Subject: Re: bug#31852: Make memory-limit obsolete To: Eli Zaretskii References: <510fa6e2-38e5-f5cf-e1c8-4a1a553a162d@cs.ucla.edu> <83in6j1bus.fsf@gnu.org> <36f43145-ab73-d6e4-ae70-4d801bfe7583@cs.ucla.edu> <83o9gazses.fsf@gnu.org> From: Paul Eggert Openpgp: preference=signencrypt Autocrypt: addr=eggert@cs.ucla.edu; prefer-encrypt=mutual; keydata= xsFNBEyAcmQBEADAAyH2xoTu7ppG5D3a8FMZEon74dCvc4+q1XA2J2tBy2pwaTqfhpxxdGA9 Jj50UJ3PD4bSUEgN8tLZ0san47l5XTAFLi2456ciSl5m8sKaHlGdt9XmAAtmXqeZVIYX/UFS 96fDzf4xhEmm/y7LbYEPQdUdxu47xA5KhTYp5bltF3WYDz1Ygd7gx07Auwp7iw7eNvnoDTAl KAl8KYDZzbDNCQGEbpY3efZIvPdeI+FWQN4W+kghy+P6au6PrIIhYraeua7XDdb2LS1en3Ss mE3QjqfRqI/A2ue8JMwsvXe/WK38Ezs6x74iTaqI3AFH6ilAhDqpMnd/msSESNFt76DiO1ZK QMr9amVPknjfPmJISqdhgB1DlEdw34sROf6V8mZw0xfqT6PKE46LcFefzs0kbg4GORf8vjG2 Sf1tk5eU8MBiyN/bZ03bKNjNYMpODDQQwuP84kYLkX2wBxxMAhBxwbDVZudzxDZJ1C2VXujC OJVxq2kljBM9ETYuUGqd75AW2LXrLw6+MuIsHFAYAgRr7+KcwDgBAfwhPBYX34nSSiHlmLC+ KaHLeCLF5ZI2vKm3HEeCTtlOg7xZEONgwzL+fdKo+D6SoC8RRxJKs8a3sVfI4t6CnrQzvJbB n6gxdgCu5i29J1QCYrCYvql2UyFPAK+do99/1jOXT4m2836j1wARAQABzSBQYXVsIEVnZ2Vy dCA8ZWdnZXJ0QGNzLnVjbGEuZWR1PsLBfgQTAQIAKAUCTIByZAIbAwUJEswDAAYLCQgHAwIG FQgCCQoLBBYCAwECHgECF4AACgkQ7ZfpDmKqfjRRGw/+Ij03dhYfYl/gXVRiuzV1gGrbHk+t nfrI/C7fAeoFzQ5tVgVinShaPkZo0HTPf18x6IDEdAiO8Mqo1yp0CtHmzGMCJ50o4Grgfjlr 6g/+vtEOKbhleszN2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JEcVBafdspJnYQxBYNco2LFPIhlOvWh8r4at+s+M3Lb26oUTczlgdW1Sf3SDA 77BMRnF0FQyE+7AzV79MBN4ykiqaezQxtaF1Fy/tvkhffSo8u+dwG0EgJh+te38gTcISVr0G IPplLz6YhjrbHrPRF1CN5UuL9DBGjxuN35RLNVEfta6RUFlR6NctTjvrABEBAAHCwWUEGAEC AA8FAkyAcmQCGwwFCRLMAwAACgkQ7ZfpDmKqfjSrHA/+KzAKvTxRhA9MWNLxIyJ7S5uJ16gs T3oCjZrBKGEhKMOGX4O0GA6VOEryO7QRCCYah3oxSG38IAnNeiwJXgU9Bzkk85UGbPEd7HGF /VSeHCQwWou6jqUDTSDvn9YhNTdG0KXPM74aC+xr2Zow1O2mhXihgWKD0Dw+0LYPnUOsQ0KO FxHXXYHmRrS1OZPU59BLvc+TRhIhafSHKLwbXK+6ckkxBx6h8z5ccpG0Qs4bFhdFYnFrEieD LoGmnE2YLhdV6swJ9VNCS6pLiEohT3fm7aXm15tZOIyzMZhHRSAPblXxQ0ZSWjq8oRrcYNFx c4W1URpAkBCOYJoXvQfD5L3lqAl8TCqDUzYxhH/tJhbDdHrqHH767jaDaTB1+Talp/2AMKwc XNOdiklGxbmHVG6YGl6g8Lrbsu9NZEI4yLlHzuikthJWgz+3vZhVGyNlt+HNIoF6CjDL2omu 5cEq4RDHM44QqPk6l7O0pUvN1mT4B+S1b08RKpqm/ff015E37HNV/piIvJlxGAYz8PSfuGCB 1thMYqlmgdhd9/BabGFbGGYHA6U4/T5zqU+f6xHy1SsAQZ1MSKlLwekBIT+4/cLRGqCHjnV0 q5H/T6a7t5mPkbzSrOLSo4puj+IToNjYyYIDBWzhlA19avOa+rvUjmHtD3sFN7cXWtkGoi8b uNcby4U= Organization: UCLA Computer Science Department Message-ID: Date: Sat, 16 Jun 2018 08:34:52 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <83o9gazses.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 31852-done Cc: 31852-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii wrote: > If nobody uses the function, I see no gain at all, because obsoleting > a function tells those who use it not to. If Emacs has useless and confusing features that consume documentation sp= ace and=20 implementation resources, that is a net harm to current and future users.= =20 Omitting such features is therefore a net gain to users. The benefit to u= sers by=20 omitting useless and confusing features is worth the maintenance cost to = us of=20 obsoleting these features. That being said, it appears I haven't convinced you to obsolete memory-li= mit, so=20 I installed patch 1 but not patch 2 and am closing the bug report. ------------=_1529163363-19147-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 16 Jun 2018 01:34:10 +0000 Received: from localhost ([127.0.0.1]:50748 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fU06S-0000MH-Ej for submit@debbugs.gnu.org; Fri, 15 Jun 2018 21:34:10 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60037) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fU06Q-0000Ll-9A for submit@debbugs.gnu.org; Fri, 15 Jun 2018 21:34:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fU06J-0003BJ-Ec for submit@debbugs.gnu.org; Fri, 15 Jun 2018 21:34:01 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:48192) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fU06J-0003B2-9L for submit@debbugs.gnu.org; Fri, 15 Jun 2018 21:33:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fU06F-00030z-NH for bug-gnu-emacs@gnu.org; Fri, 15 Jun 2018 21:33:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fU06C-00030a-IQ for bug-gnu-emacs@gnu.org; Fri, 15 Jun 2018 21:33:55 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:50158) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fU06C-0002wl-6S for bug-gnu-emacs@gnu.org; Fri, 15 Jun 2018 21:33:52 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 0383616087B for ; Fri, 15 Jun 2018 18:33:49 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id dhOiKG05qMdT for ; Fri, 15 Jun 2018 18:33:47 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id D02CB16099B for ; Fri, 15 Jun 2018 18:33:47 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id szDvIe_5LXtS for ; Fri, 15 Jun 2018 18:33:47 -0700 (PDT) Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id B019A16087B for ; Fri, 15 Jun 2018 18:33:47 -0700 (PDT) To: Emacs bug reports From: Paul Eggert Subject: Make memory-limit obsolete Openpgp: preference=signencrypt Autocrypt: addr=eggert@cs.ucla.edu; prefer-encrypt=mutual; keydata= xsFNBEyAcmQBEADAAyH2xoTu7ppG5D3a8FMZEon74dCvc4+q1XA2J2tBy2pwaTqfhpxxdGA9 Jj50UJ3PD4bSUEgN8tLZ0san47l5XTAFLi2456ciSl5m8sKaHlGdt9XmAAtmXqeZVIYX/UFS 96fDzf4xhEmm/y7LbYEPQdUdxu47xA5KhTYp5bltF3WYDz1Ygd7gx07Auwp7iw7eNvnoDTAl KAl8KYDZzbDNCQGEbpY3efZIvPdeI+FWQN4W+kghy+P6au6PrIIhYraeua7XDdb2LS1en3Ss mE3QjqfRqI/A2ue8JMwsvXe/WK38Ezs6x74iTaqI3AFH6ilAhDqpMnd/msSESNFt76DiO1ZK QMr9amVPknjfPmJISqdhgB1DlEdw34sROf6V8mZw0xfqT6PKE46LcFefzs0kbg4GORf8vjG2 Sf1tk5eU8MBiyN/bZ03bKNjNYMpODDQQwuP84kYLkX2wBxxMAhBxwbDVZudzxDZJ1C2VXujC OJVxq2kljBM9ETYuUGqd75AW2LXrLw6+MuIsHFAYAgRr7+KcwDgBAfwhPBYX34nSSiHlmLC+ KaHLeCLF5ZI2vKm3HEeCTtlOg7xZEONgwzL+fdKo+D6SoC8RRxJKs8a3sVfI4t6CnrQzvJbB n6gxdgCu5i29J1QCYrCYvql2UyFPAK+do99/1jOXT4m2836j1wARAQABzSBQYXVsIEVnZ2Vy dCA8ZWdnZXJ0QGNzLnVjbGEuZWR1PsLBfgQTAQIAKAUCTIByZAIbAwUJEswDAAYLCQgHAwIG FQgCCQoLBBYCAwECHgECF4AACgkQ7ZfpDmKqfjRRGw/+Ij03dhYfYl/gXVRiuzV1gGrbHk+t nfrI/C7fAeoFzQ5tVgVinShaPkZo0HTPf18x6I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Yxnyg9cZazWA5VslvTxpm76hbg5oiAEH/Vg/8MxHyA nPhfrgwyPrmJEcVBafdspJnYQxBYNco2LFPIhlOvWh8r4at+s+M3Lb26oUTczlgdW1Sf3SDA 77BMRnF0FQyE+7AzV79MBN4ykiqaezQxtaF1Fy/tvkhffSo8u+dwG0EgJh+te38gTcISVr0G IPplLz6YhjrbHrPRF1CN5UuL9DBGjxuN35RLNVEfta6RUFlR6NctTjvrABEBAAHCwWUEGAEC AA8FAkyAcmQCGwwFCRLMAwAACgkQ7ZfpDmKqfjSrHA/+KzAKvTxRhA9MWNLxIyJ7S5uJ16gs T3oCjZrBKGEhKMOGX4O0GA6VOEryO7QRCCYah3oxSG38IAnNeiwJXgU9Bzkk85UGbPEd7HGF /VSeHCQwWou6jqUDTSDvn9YhNTdG0KXPM74aC+xr2Zow1O2mhXihgWKD0Dw+0LYPnUOsQ0KO FxHXXYHmRrS1OZPU59BLvc+TRhIhafSHKLwbXK+6ckkxBx6h8z5ccpG0Qs4bFhdFYnFrEieD LoGmnE2YLhdV6swJ9VNCS6pLiEohT3fm7aXm15tZOIyzMZhHRSAPblXxQ0ZSWjq8oRrcYNFx c4W1URpAkBCOYJoXvQfD5L3lqAl8TCqDUzYxhH/tJhbDdHrqHH767jaDaTB1+Talp/2AMKwc XNOdiklGxbmHVG6YGl6g8Lrbsu9NZEI4yLlHzuikthJWgz+3vZhVGyNlt+HNIoF6CjDL2omu 5cEq4RDHM44QqPk6l7O0pUvN1mT4B+S1b08RKpqm/ff015E37HNV/piIvJlxGAYz8PSfuGCB 1thMYqlmgdhd9/BabGFbGGYHA6U4/T5zqU+f6xHy1SsAQZ1MSKlLwekBIT+4/cLRGqCHjnV0 q5H/T6a7t5mPkbzSrOLSo4puj+IToNjYyYIDBWzhlA19avOa+rvUjmHtD3sFN7cXWtkGoi8b uNcby4U= Organization: UCLA Computer Science Department Message-ID: <510fa6e2-38e5-f5cf-e1c8-4a1a553a162d@cs.ucla.edu> Date: Fri, 15 Jun 2018 18:33:47 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------200693BE6EBF92F49695F538" Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) This is a multi-part message in MIME format. --------------200693BE6EBF92F49695F538 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Tags: patch The memory-limit function has an implementation that is a relic of long-ago days when the heap was allocated via sbrk. This assumption is often no longer true now that ASLR is popular, and once we get portable dumping work it'll be true even less often. Since memory-limit returns nonsense so often and since nobody cares, we can and should mark memory-limit as obsolete. On its way out we can move it to a Lisp implementation and cause it to be at least somewhat more plausible. Proposed patches attached. The first patch moves memory-limit to Lisp, the second one marks it obsolete. I didn't know where to put the Lisp implementation so I put it into lisp/subr.el. --------------200693BE6EBF92F49695F538 Content-Type: text/x-patch; name="0001-Rewrite-memory-limit-in-Lisp.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Rewrite-memory-limit-in-Lisp.patch" >From 52f4585c1353c3c12079bc7bfe85ef44755134db Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 15 Jun 2018 18:05:28 -0700 Subject: [PATCH 1/2] Rewrite memory-limit in Lisp Have it return Emacs virtual memory size, not the sbrk value which is often useless newadays. * doc/lispref/internals.texi (Garbage Collection): * etc/NEWS: Document this. * lisp/subr.el (memory-limit): New implementation in Lisp, written in terms of process-attributes, and which returns virtual memory size. * src/alloc.c (Fmemory_limit): Remove C implementation. --- doc/lispref/internals.texi | 6 ++---- etc/NEWS | 3 +++ lisp/subr.el | 4 ++++ src/alloc.c | 19 ------------------- 4 files changed, 9 insertions(+), 23 deletions(-) diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index 9cf1a4f9a3..faaf26f4f7 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi @@ -507,10 +507,8 @@ Garbage Collection memory Emacs is currently using. @defun memory-limit -This function returns the address of the last byte Emacs has allocated, -divided by 1024. We divide the value by 1024 to make sure it fits in a -Lisp integer. - +This function returns an estimate of the total amount of bytes of +virtual memory that Emacs is currently using, divided by 1024. You can use this to get a general idea of how your actions affect the memory usage. @end defun diff --git a/etc/NEWS b/etc/NEWS index e89402db13..30409a89b5 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -656,6 +656,9 @@ socket has been passed to Emacs (Bug#24218). instead of just Microsoft platforms. This fixes a 'get-free-disk-space' bug on OS X 10.8 and later (Bug#28639). ++++ +** 'memory-limit' now returns a better estimate of memory consumption. + +++ ** New macro 'combine-change-calls' arranges to call the change hooks ('before-change-functions' and 'after-change-functions') just once diff --git a/lisp/subr.el b/lisp/subr.el index 914112ccef..e4da2b2075 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2182,6 +2182,10 @@ process-put (set-process-plist process (plist-put (process-plist process) propname value))) +(defun memory-limit () + "Return an estimate of Emacs virtual memory usage, divided by 1024." + (or (cdr (assq 'vsize (process-attributes (emacs-pid)))) 0)) + ;;;; Input and display facilities. diff --git a/src/alloc.c b/src/alloc.c index 7b2140501e..52620a54ac 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -7120,24 +7120,6 @@ or memory information can't be obtained, return nil. */) /* Debugging aids. */ -DEFUN ("memory-limit", Fmemory_limit, Smemory_limit, 0, 0, 0, - doc: /* Return the address of the last byte Emacs has allocated, divided by 1024. -This may be helpful in debugging Emacs's memory usage. -We divide the value by 1024 to make sure it fits in a Lisp integer. */) - (void) -{ - Lisp_Object end; - -#if defined HAVE_NS || defined __APPLE__ || !HAVE_SBRK - /* Avoid warning. sbrk has no relation to memory allocated anyway. */ - XSETINT (end, 0); -#else - XSETINT (end, (intptr_t) (char *) sbrk (0) / 1024); -#endif - - return end; -} - DEFUN ("memory-use-counts", Fmemory_use_counts, Smemory_use_counts, 0, 0, 0, doc: /* Return a list of counters that measure how much consing there has been. Each of these counters increments for a certain kind of object. @@ -7495,7 +7477,6 @@ The time is in seconds as a floating point value. */); defsubr (&Smake_finalizer); defsubr (&Spurecopy); defsubr (&Sgarbage_collect); - defsubr (&Smemory_limit); defsubr (&Smemory_info); defsubr (&Smemory_use_counts); defsubr (&Ssuspicious_object); -- 2.17.1 --------------200693BE6EBF92F49695F538 Content-Type: text/x-patch; name="0002-Obsolete-memory-limit.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0002-Obsolete-memory-limit.patch" >From 5645d547959780e21fe7c5eff12a0d0ae22702da Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 15 Jun 2018 18:21:10 -0700 Subject: [PATCH 2/2] Obsolete memory-limit * doc/lispref/internals.texi (Garbage Collection): Remove documentation of memory-limit. * etc/NEWS: Say it's obsolete. * lisp/subr.el (memory-limit): Declare that it's obsolete. --- doc/lispref/internals.texi | 7 ------- etc/NEWS | 3 ++- lisp/subr.el | 1 + 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index faaf26f4f7..e8fe26856c 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi @@ -506,13 +506,6 @@ Garbage Collection function @code{memory-limit} provides information on the total amount of memory Emacs is currently using. -@defun memory-limit -This function returns an estimate of the total amount of bytes of -virtual memory that Emacs is currently using, divided by 1024. -You can use this to get a general idea of how your actions affect the -memory usage. -@end defun - @defvar memory-full This variable is @code{t} if Emacs is nearly out of memory for Lisp objects, and @code{nil} otherwise. diff --git a/etc/NEWS b/etc/NEWS index 30409a89b5..a1f853e8cd 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -657,7 +657,8 @@ instead of just Microsoft platforms. This fixes a 'get-free-disk-space' bug on OS X 10.8 and later (Bug#28639). +++ -** 'memory-limit' now returns a better estimate of memory consumption. +** The 'memory-limit' function is now obsolete. You can use +the 'vsize' component of (process-attributes (emacs-pid)) instead. +++ ** New macro 'combine-change-calls' arranges to call the change hooks diff --git a/lisp/subr.el b/lisp/subr.el index e4da2b2075..6af32c95bc 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2184,6 +2184,7 @@ process-put (defun memory-limit () "Return an estimate of Emacs virtual memory usage, divided by 1024." + (declare (obsolete process-attributes "27.1")) (or (cdr (assq 'vsize (process-attributes (emacs-pid)))) 0)) -- 2.17.1 --------------200693BE6EBF92F49695F538-- ------------=_1529163363-19147-1-- From unknown Sun Jun 22 11:49:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#31852: Make memory-limit obsolete Resent-From: "Daniel Colascione" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Jun 2018 15:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31852 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 31852@debbugs.gnu.org, eggert@cs.ucla.edu, eggert@cs.ucla.edu Received: via spool by 31852-submit@debbugs.gnu.org id=B31852.152916431120558 (code B ref 31852); Sat, 16 Jun 2018 15:52:02 +0000 Received: (at 31852) by debbugs.gnu.org; 16 Jun 2018 15:51:51 +0000 Received: from localhost ([127.0.0.1]:51842 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fUDUV-0005LV-AN for submit@debbugs.gnu.org; Sat, 16 Jun 2018 11:51:51 -0400 Received: from dancol.org ([96.126.100.184]:58800) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fUDUT-0005LM-Ib for 31852@debbugs.gnu.org; Sat, 16 Jun 2018 11:51:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Transfer-Encoding:Content-Type:MIME-Version:To:From:Subject:Date:References:In-Reply-To:Message-ID; bh=NDOQs3EFYT5lQdeJk9L09HwePj/sV6n67BDEEFjG9lQ=; b=MEXLSRzgatNi45hQf+Ziyf3GrR9Q67sbmwWIDX+xYozac3uRXc9/p20x41gIcCi4qRucxydGGa4/D7CNFPlEWQIQV8eLOQxKJHRujtyjKjO0nIThL7UALZ74jmzjeXSA/VAoPSHHdxDAsxs61jVaMlflT7HmezqAJZeHZA1AeF4xp7S91+GnUWA2mWPuqwkQ42LAuzZAqKLjjM5/ct4/cSqW42bzJ+SUnGYBlFuaXhL/kHVir0ZeNx6Rb78zKPi82EIX38LZxWSBBWeEBT7gnsCyG2tbmBC8dClCwtf8jiPQyxGgK6uPnGHdYShL9Aw3K8WtgW2UTng40udLA2oNiQ==; Received: from localhost ([127.0.0.1] helo=dancol.org) by dancol.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fUDUR-00026Q-QB; Sat, 16 Jun 2018 08:51:47 -0700 Received: from 127.0.0.1 (SquirrelMail authenticated user dancol) by dancol.org with HTTP; Sat, 16 Jun 2018 08:51:47 -0700 Message-ID: In-Reply-To: References: <510fa6e2-38e5-f5cf-e1c8-4a1a553a162d@cs.ucla.edu> <83in6j1bus.fsf@gnu.org> <36f43145-ab73-d6e4-ae70-4d801bfe7583@cs.ucla.edu> <83o9gazses.fsf@gnu.org> Date: Sat, 16 Jun 2018 08:51:47 -0700 From: "Daniel Colascione" User-Agent: SquirrelMail/1.4.23 [SVN] MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Eli Zaretskii wrote: > >> If nobody uses the function, I see no gain at all, because obsoleting >> a function tells those who use it not to. > > If Emacs has useless and confusing features that consume documentation > space and > implementation resources, that is a net harm to current and future users. > Omitting such features is therefore a net gain to users. The benefit to > users by > omitting useless and confusing features is worth the maintenance cost to > us of > obsoleting these features. > > That being said, it appears I haven't convinced you to obsolete > memory-limit, so > I installed patch 1 but not patch 2 and am closing the bug report. I agree with obsoleting memory-limit. I don't like the vsize patch you installed though: what does the amount of address space reserved actually tell anyone? There's no relationship to actual resource consumption. IMHO, memory-limit should return a combination of the Lisp heap size with whatever malloc says is its own heap size. From unknown Sun Jun 22 11:49:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#31852: Make memory-limit obsolete Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Jun 2018 16:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31852 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Daniel Colascione , 31852@debbugs.gnu.org Received: via spool by 31852-submit@debbugs.gnu.org id=B31852.152916646223913 (code B ref 31852); Sat, 16 Jun 2018 16:28:02 +0000 Received: (at 31852) by debbugs.gnu.org; 16 Jun 2018 16:27:42 +0000 Received: from localhost ([127.0.0.1]:51903 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fUE3C-0006Dd-Cl for submit@debbugs.gnu.org; Sat, 16 Jun 2018 12:27:42 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:51352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fUE3A-0006DQ-Ad for 31852@debbugs.gnu.org; Sat, 16 Jun 2018 12:27:40 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 8DD8516066D; Sat, 16 Jun 2018 09:27:34 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id TFMUj5-isxCv; Sat, 16 Jun 2018 09:27:33 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 53D2C16069D; Sat, 16 Jun 2018 09:27:33 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id fYoiFyxMHhA1; Sat, 16 Jun 2018 09:27:33 -0700 (PDT) Received: from [192.168.1.9] (unknown [47.154.30.119]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 538FB16066D; Sat, 16 Jun 2018 09:27:32 -0700 (PDT) References: <510fa6e2-38e5-f5cf-e1c8-4a1a553a162d@cs.ucla.edu> <83in6j1bus.fsf@gnu.org> <36f43145-ab73-d6e4-ae70-4d801bfe7583@cs.ucla.edu> <83o9gazses.fsf@gnu.org> From: Paul Eggert Openpgp: preference=signencrypt Autocrypt: addr=eggert@cs.ucla.edu; prefer-encrypt=mutual; keydata= xsFNBEyAcmQBEADAAyH2xoTu7ppG5D3a8FMZEon74dCvc4+q1XA2J2tBy2pwaTqfhpxxdGA9 Jj50UJ3PD4bSUEgN8tLZ0san47l5XTAFLi2456ciSl5m8sKaHlGdt9XmAAtmXqeZVIYX/UFS 96fDzf4xhEmm/y7LbYEPQdUdxu47xA5KhTYp5bltF3WYDz1Ygd7gx07Auwp7iw7eNvnoDTAl KAl8KYDZzbDNCQGEbpY3efZIvPdeI+FWQN4W+kghy+P6au6PrIIhYraeua7XDdb2LS1en3Ss mE3Qjq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Dw+0LYPnUOsQ0KO FxHXXYHmRrS1OZPU59BLvc+TRhIhafSHKLwbXK+6ckkxBx6h8z5ccpG0Qs4bFhdFYnFrEieD LoGmnE2YLhdV6swJ9VNCS6pLiEohT3fm7aXm15tZOIyzMZhHRSAPblXxQ0ZSWjq8oRrcYNFx c4W1URpAkBCOYJoXvQfD5L3lqAl8TCqDUzYxhH/tJhbDdHrqHH767jaDaTB1+Talp/2AMKwc XNOdiklGxbmHVG6YGl6g8Lrbsu9NZEI4yLlHzuikthJWgz+3vZhVGyNlt+HNIoF6CjDL2omu 5cEq4RDHM44QqPk6l7O0pUvN1mT4B+S1b08RKpqm/ff015E37HNV/piIvJlxGAYz8PSfuGCB 1thMYqlmgdhd9/BabGFbGGYHA6U4/T5zqU+f6xHy1SsAQZ1MSKlLwekBIT+4/cLRGqCHjnV0 q5H/T6a7t5mPkbzSrOLSo4puj+IToNjYyYIDBWzhlA19avOa+rvUjmHtD3sFN7cXWtkGoi8b uNcby4U= Organization: UCLA Computer Science Department Message-ID: <4725df6e-aaf2-548d-173e-694aa86da918@cs.ucla.edu> Date: Sat, 16 Jun 2018 09:27:30 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Daniel Colascione wrote: > I agree with obsoleting memory-limit. I don't like the vsize patch you > installed though: what does the amount of address space reserved actual= ly > tell anyone? There's no relationship to actual resource consumption. It's not that good a number, true; but it's better than the number we wer= e=20 returning, which was typically nonsense. One of the benefits of moving memory-limit to Lisp was the removal of the= bogus=20 call to sbrk. Emacs should never call sbrk, and once the portable dumper = code is=20 merged, Emacs won't ever need to call sbrk again. Yay! All things considered, I'd rather not go down the rabbit hole of trying t= o=20 improve memory-limit further, because memory-limit was a mistake in the f= irst=20 place and nobody uses it (and rightly so) and we should be deprecating it= rather=20 than trying to improve it. That being said, if you'd like to make it bett= er=20 please feel free.