From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.org!not-for-mail
From: Glenn Morris <rgm@gnu.org>
Newsgroups: gmane.emacs.devel
Subject: Re: warn-maybe-out-of-memory
Date: Sat, 12 Jul 2014 13:17:54 -0400
Message-ID: <5kpphafqd9.fsf@fencepost.gnu.org>
References: <83egxtax97.fsf@gnu.org> <83d2ddaw52.fsf@gnu.org>
	<53BF6B2F.5030701@yandex.ru> <837g3kbd9g.fsf@gnu.org>
	<53BFA3BB.6090709@yandex.ru> <8361j4b744.fsf@gnu.org>
	<53BFB1C3.9020202@yandex.ru> <jwv61j4j9u9.fsf-monnier+emacs@gnu.org>
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: ger.gmane.org 1405185492 32357 80.91.229.3 (12 Jul 2014 17:18:12 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 12 Jul 2014 17:18:12 +0000 (UTC)
Cc: Eli Zaretskii <eliz@gnu.org>, Dmitry Antipov <dmantipov@yandex.ru>,
	emacs-devel@gnu.org
To: Stefan Monnier <monnier@iro.umontreal.ca>
Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 12 19:18:03 2014
Return-path: <emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org>
Envelope-to: ged-emacs-devel@m.gmane.org
Original-Received: from lists.gnu.org ([208.118.235.17])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org>)
	id 1X60vx-0004iu-1F
	for ged-emacs-devel@m.gmane.org; Sat, 12 Jul 2014 19:18:01 +0200
Original-Received: from localhost ([::1]:49797 helo=lists.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org>)
	id 1X60vw-0002Tl-Hs
	for ged-emacs-devel@m.gmane.org; Sat, 12 Jul 2014 13:18:00 -0400
Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54497)
	by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <rgm@gnu.org>)
	id 1X60vt-0002TP-1J
	for emacs-devel@gnu.org; Sat, 12 Jul 2014 13:17:57 -0400
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <rgm@gnu.org>) id 1X60vr-0005Y5-Uv
	for emacs-devel@gnu.org; Sat, 12 Jul 2014 13:17:56 -0400
Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59118)
	by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <rgm@gnu.org>)
	id 1X60vr-0005Xz-Rn
	for emacs-devel@gnu.org; Sat, 12 Jul 2014 13:17:55 -0400
Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.71)
	(envelope-from <rgm@gnu.org>)
	id 1X60vq-0007hO-AW; Sat, 12 Jul 2014 13:17:54 -0400
X-Spook: Guantanamo IRA Semtex Indigo Pine Gap subversive
X-Ran: o!\QUA{/qcF'L@#S^wgKubU,</ya1P$'X|H]7334-1WNtz#[!z$gx'8Z\L^|wMzUcE*"(0
X-Hue: magenta
X-Attribution: GM
User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
	(bad octet value).
X-Received-From: 2001:4830:134:3::e
X-BeenThere: emacs-devel@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Emacs development discussions." <emacs-devel.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-devel>,
	<mailto:emacs-devel-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/emacs-devel>
List-Post: <mailto:emacs-devel@gnu.org>
List-Help: <mailto:emacs-devel-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-devel>,
	<mailto:emacs-devel-request@gnu.org?subject=subscribe>
Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org
Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org
Xref: news.gmane.org gmane.emacs.devel:173003
Archived-At: <http://permalink.gmane.org/gmane.emacs.devel/173003>

Stefan Monnier wrote:

>> This depends on OS and VM pressure. For example, on GNU/Linux if I have
>> just slightly above 8G free:
>
>> $ free
>>              total       used       free     shared    buffers     cached
>> Mem:      16127204    7762072    8365132      68248      84396    6401276
>> -/+ buffers/cache:    1276400   14850804
>
> Here's another problem: what kind of "free memory" do you measure?

I'd also like to know. If it really is the 8G amount in the example
above, then as you say that seems just plain wrong for Emacs to warn
about. If it subtracts off the cache, that's still wrong if you have any
swap space. The total memory is not wrong, but frankly seems completely
pointless. Because who is opening a file with Emacs that matches the
amount of RAM on their machine? The performance of Emacs is pretty poor
with large files - the default large-file-warning-threshold is 10MB!