From: Philipp Stephani <p.stephani2@gmail.com>
To: "Milan Stanojević" <mstanojevic@janestreet.com>
Cc: 42482-done@debbugs.gnu.org
Subject: bug#42482: 27.0.91; emacs modules memory leak
Date: Thu, 23 Jul 2020 16:33:12 +0200 [thread overview]
Message-ID: <CAArVCkRMUkt4jkdGZYV52J=O_-+-KjaRWejZFjHKXUJdrMVw=A@mail.gmail.com> (raw)
In-Reply-To: <CAArdBwO6BofPpfNBFeQ3QZnRavHc4D8T_r54RkZebPkQBGTwbg@mail.gmail.com>
Am Do., 23. Juli 2020 um 16:29 Uhr schrieb Milan Stanojević
<mstanojevic@janestreet.com>:
>
> Thank you for the quick fix.
> Is there a chance this also goes to emacs-27 branch so it can be in
> the emacs 27.1 when it gets released?
I think backporting the fix should be fine, as the fix is rather
localized and fixes a regression. Eli?
>
> On Thu, Jul 23, 2020 at 8:07 AM Philipp Stephani <p.stephani2@gmail.com> wrote:
> >
> > Am Do., 23. Juli 2020 um 01:27 Uhr schrieb Milan Stanojević
> > <mstanojevic@janestreet.com>:
> > >
> > > env-make_global_ref adds a reference to the underlying Lisp_Object
> > > and allocates emacs_value from the global storage. env->free_global_ref
> > > on the other hand will only remove a reference to the underlying
> > > Lisp_Object and not free the emacs_value.
> > >
> > > Here is a simple recipe to reproduce the problem (I only tested this
> > > on linux). I'm attaching the necessary files.
> > >
> > > $ gcc -shared -fpic -std=c99 -I <dir-with-emacs-module.h>
> > > create_global_refs.c -o create_global_refs.so
> > > $ emacs --no-splash -q -l create_global_refs.so -l create_global_refs_test.el
> > >
> > > If you look at the memory usage of emacs (for example in htop) you'll
> > > see that with emacs-26 it is constant but with emacs-27 the resident
> > > memory quickly grows.
> >
> > Thanks for the report. I've fixed this in commit
> > 5c5eb9790898e4ab10bcbbdb6871947ed3018569; the fix is slightly
> > different from what you proposed in that it stores the emacs_value
> > object in the global references hashtable, but it should have the same
> > effect. At least I can't reproduce the symptom any more after that
> > commit.
next prev parent reply other threads:[~2020-07-23 14:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-22 23:25 bug#42482: 27.0.91; emacs modules memory leak Milan Stanojević
2020-07-23 12:06 ` Philipp Stephani
2020-07-23 14:29 ` Milan Stanojević
2020-07-23 14:33 ` Philipp Stephani [this message]
2020-07-23 17:45 ` Eli Zaretskii
2020-07-23 19:11 ` Milan Stanojević
2020-07-25 21:43 ` Philipp Stephani
2020-08-01 12:11 ` Philipp Stephani
2020-08-01 12:37 ` Eli Zaretskii
2020-08-01 12:55 ` Nicolas Petton
2020-08-01 14:47 ` Philipp Stephani
2020-08-02 17:25 ` Eli Zaretskii
2020-08-03 23:02 ` Milan Stanojević
2020-08-04 8:05 ` Nicolas Petton
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='CAArVCkRMUkt4jkdGZYV52J=O_-+-KjaRWejZFjHKXUJdrMVw=A@mail.gmail.com' \
--to=p.stephani2@gmail.com \
--cc=42482-done@debbugs.gnu.org \
--cc=mstanojevic@janestreet.com \
/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.