unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Dmitry Antipov <dmantipov@yandex.ru>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: warn-maybe-out-of-memory
Date: Fri, 11 Jul 2014 09:46:15 -0400	[thread overview]
Message-ID: <jwv61j4j9u9.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <53BFB1C3.9020202@yandex.ru> (Dmitry Antipov's message of "Fri, 11 Jul 2014 13:43:31 +0400")


I'm actually wondering what is the use case.  Concretely.

"If file looks so large that `find-file-noselect' is likely to run out of
memory" is not very concrete.  In what kind of situation could this happen?
Especially:
- in which situation is could this be useful given that we
  already have large-file-warning-threshold?
- would using find-file-literally solve the problem?

> 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?
The above "free" measurement should normally be *very* small.
Your above sample of 8G free typically means one of two things:
- The Linux kernel's heuristics failed to make good use of your memory.
- You have too much memory for what you do ("you wasted your money").
So it's perfectly normal to open a file that's larger than this "free"
amount, since the goal of the kernel's memory management is to keep this
"free" about as low as possible (tho not quite 0, just so we can quickly
respond to new memory requests).


        Stefan



  parent reply	other threads:[~2014-07-11 13:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-10 18:23 warn-maybe-out-of-memory Eli Zaretskii
2014-07-10 18:47 ` warn-maybe-out-of-memory Eli Zaretskii
2014-07-11  4:42   ` warn-maybe-out-of-memory Dmitry Antipov
2014-07-11  6:50     ` warn-maybe-out-of-memory Eli Zaretskii
2014-07-11  8:43       ` warn-maybe-out-of-memory Dmitry Antipov
2014-07-11  9:02         ` warn-maybe-out-of-memory Eli Zaretskii
2014-07-11  9:43           ` warn-maybe-out-of-memory Dmitry Antipov
2014-07-11 10:00             ` warn-maybe-out-of-memory Eli Zaretskii
2014-07-11 10:14               ` warn-maybe-out-of-memory Eli Zaretskii
2014-07-11 10:34               ` warn-maybe-out-of-memory Dmitry Antipov
2014-07-11 12:43                 ` warn-maybe-out-of-memory Eli Zaretskii
2014-07-11 13:46             ` Stefan Monnier [this message]
2014-07-12 17:17               ` warn-maybe-out-of-memory Glenn Morris
2014-07-13  7:01                 ` warn-maybe-out-of-memory Dmitry Antipov
2014-07-13 23:00                   ` warn-maybe-out-of-memory Glenn Morris
2014-07-15  3:45                   ` warn-maybe-out-of-memory Stefan Monnier
2014-07-15  4:44                     ` warn-maybe-out-of-memory Dmitry Antipov
2014-07-17  3:59                       ` warn-maybe-out-of-memory Stefan Monnier
2014-07-11 13:28     ` warn-maybe-out-of-memory Drew Adams
  -- strict thread matches above, loose matches on Subject: below --
2014-07-10 18:22 warn-maybe-out-of-memory Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv61j4j9u9.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=dmantipov@yandex.ru \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).