all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: mail@daniel-mendler.de
Cc: 46326@debbugs.gnu.org
Subject: bug#46326: 27.1.50; Excessive memory allocations with minibuffer-with-setup-hook
Date: Fri, 05 Feb 2021 16:09:09 +0200	[thread overview]
Message-ID: <83eehuppx6.fsf@gnu.org> (raw)
In-Reply-To: <62c490ed0d8d24d8b259ac1ba55ea79e@mendler.net> (mail@daniel-mendler.de)

> Date: Fri, 05 Feb 2021 13:51:41 +0100
> From: mail@daniel-mendler.de
> 
> I have an issue on 27.1.50 with excessive memory allocations when using
> minibuffer-with-setup-hook with large closures and :append. This issue 
> has been
> observed in my Consult package, which is similar to Counsel and which 
> provides
> commands based on completing-read. Naturally I have to perform some 
> setup in the
> minibuffer-setup-hook. Most of the memory allocations are due to 
> add-hook and in
> particular the sort function. The sort functions is called because of 
> :append
> which sets a hook priority. The reason seems to be that large closures 
> are
> copied, but I didn't fully investigate the reasons for the issue.
> 
> Example profile:
> 
>      140,068,687  92%       - consult-buffer
>      140,068,687  92%        - consult--buffer

Please show information about the memory consumption.  (The so-called
"memory profile" doesn't actually measure memory consumption at all,
it just uses memory allocation calls as a poor-man's profiling
signal.)

Please show a recipe starting from "emacs -Q" where a lot of memory is
being consumed, and please show how much memory does the recipe
consume.  Also, I presume invoking "M-x garbage-collect RET" doesn't
release that memory?  If so, please show the return value of
garbage-collect.

> See the issue https://github.com/minad/consult/issues/193 for reference.

I don't see any memory information in that discussion.  I guess you
thought the memory profiler somehow shows memory consumption, but it
doesn't.

What exactly caused you to run the profiler? is the code slow or
something?  If so, the problem may be something other than memory
consumption.





  reply	other threads:[~2021-02-05 14:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-05 12:51 bug#46326: 27.1.50; Excessive memory allocations with minibuffer-with-setup-hook mail
2021-02-05 14:09 ` Eli Zaretskii [this message]
2021-02-05 15:20   ` mail
2021-02-05 15:58     ` Eli Zaretskii
2021-02-05 16:10       ` mail
2021-02-08  9:25 ` jakanakaevangeli
2021-02-09  0:19   ` mail
2021-02-09 22:13     ` jakanakaevangeli
2021-04-23 18:26 ` Stefan Monnier
2021-04-23 19:28   ` Daniel Mendler
2021-04-23 20:34     ` jakanakaevangeli
2021-04-23 20:52       ` Daniel Mendler
2021-04-23 21:27     ` Stefan Monnier
2021-04-24  6:10       ` Eli Zaretskii
2021-04-24 13:06         ` Stefan Monnier
2022-06-16 13:06       ` Lars Ingebrigtsen

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

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

  git send-email \
    --in-reply-to=83eehuppx6.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=46326@debbugs.gnu.org \
    --cc=mail@daniel-mendler.de \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.