From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Eli Zaretskii <eliz@gnu.org>
Cc: handa@gnu.org, emacs-devel@gnu.org
Subject: Re: Enlarge MAX_ALLOCA?
Date: Fri, 20 Jun 2014 10:43:10 -0400 [thread overview]
Message-ID: <jwv8uorr6rd.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <83zjh7ra6a.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 20 Jun 2014 16:18:53 +0300")
>> > Alternatively, how about using a different limit just in the 2 users
>> > of ALLOC_CONVERSION_WORK_AREA?
>> Why not just use `alloca' directly for those cases, then?
> With an assertion in case the size is enlarged some day?
OK.
>> >> Is this memory fragmentation problem hypothetical, or have we seen
>> >> evidence of it?
>> > Hypothetical. I just don't like seeing such frequent sequences of
>> > malloc(64K)/free() one after the other several times a second in a
>> > live session.
>> I'd expect any non-toy implementation of malloc/free to handle this
>> without any serious risk of fragmentation, to tell you the truth.
> gmalloc doesn't, at least not with ralloc.c. One of my systems keeps
> growing in memory, and the only reason I could find is these constant
> allocations.
I see, so it's not just hypothetical (tho the evidence is
circumstantial, as is usually the case: proving fragmentation is
difficult).
So I think the way to go is the following:
- see if we can allocate this area less frequently (e.g. if it's for
handling compositions, it seems like it shouldn't be needed in your
cases where you encode file names (or do your file names have parts
that require compositions?)). I.e. delay the allocation to when we
really need it.
- try to reduce the size of this area.
- if the above two is not sufficient, try and just use plain `alloca'
(tho the "delay allocation" part above might make it
difficult/impossible to use alloca).
> Strange thing is, this only happens on 1 of 3 systems I use regularly,
> which all have almost identical setup.
Try to put him closer to the other 2 systems, so he'll feel ashamed.
Stefan
next prev parent reply other threads:[~2014-06-20 14:43 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-19 16:02 Enlarge MAX_ALLOCA? Eli Zaretskii
2014-06-19 16:23 ` David Kastrup
2014-06-19 16:48 ` Eli Zaretskii
2014-06-19 17:04 ` David Kastrup
2014-06-19 17:14 ` Eli Zaretskii
2014-06-19 17:36 ` David Kastrup
2014-06-19 17:51 ` Eli Zaretskii
2014-06-19 18:21 ` Stefan Monnier
2014-06-19 21:13 ` David Kastrup
2014-06-20 7:10 ` Eli Zaretskii
2014-06-20 8:08 ` David Kastrup
2014-06-20 8:38 ` Dmitry Antipov
2014-06-20 8:56 ` Eli Zaretskii
2014-06-20 9:26 ` Andreas Schwab
2014-06-20 9:38 ` David Kastrup
2014-06-19 18:28 ` Stefan Monnier
2014-06-19 18:38 ` Eli Zaretskii
2014-06-19 20:37 ` Stefan Monnier
2014-06-20 7:08 ` Eli Zaretskii
2014-06-20 13:02 ` Stefan Monnier
2014-06-20 13:18 ` Eli Zaretskii
2014-06-20 14:43 ` Stefan Monnier [this message]
2014-06-20 14:50 ` Eli Zaretskii
2014-06-20 15:15 ` Herring, Davis
2014-06-20 15:44 ` Dmitry Antipov
2014-06-20 18:36 ` Eli Zaretskii
2014-06-21 13:01 ` K. Handa
2014-06-21 13:59 ` Eli Zaretskii
2014-06-21 17:08 ` Stefan Monnier
2014-06-22 9:22 ` K. Handa
2014-06-28 14:15 ` K. Handa
2014-06-28 14:38 ` Eli Zaretskii
2014-06-21 15:19 ` David Kastrup
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=jwv8uorr6rd.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=handa@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).