unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* "memory full" during redisplay
@ 2014-12-09 18:09 Eli Zaretskii
  2014-12-09 22:05 ` Stefan Monnier
  2014-12-09 22:27 ` Paul Eggert
  0 siblings, 2 replies; 6+ messages in thread
From: Eli Zaretskii @ 2014-12-09 18:09 UTC (permalink / raw)
  To: emacs-devel

While investigating bug #19322, I found out that memory-allocation
functions called in a few places during redisplay will signal a
memory-full error when there's not enough free memory to satisfy a
request.

However, signaling an error in the middle of redisplay is not a good
idea, because Emacs will immediately re-enter redisplay, again signal
an error, etc.  This causes Emacs to lock hard, and the only thing the
user can do is forcibly terminate the process.

So I think we should modify memory_full to handle this differently
during redisplay.  Do we already have some machinery for this, or do
we need to invent something new?



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: "memory full" during redisplay
  2014-12-09 18:09 "memory full" during redisplay Eli Zaretskii
@ 2014-12-09 22:05 ` Stefan Monnier
  2014-12-09 22:27 ` Paul Eggert
  1 sibling, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2014-12-09 22:05 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

> So I think we should modify memory_full to handle this differently
> during redisplay.  Do we already have some machinery for this,

Doesn't ring a bell.


        Stefan



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: "memory full" during redisplay
  2014-12-09 18:09 "memory full" during redisplay Eli Zaretskii
  2014-12-09 22:05 ` Stefan Monnier
@ 2014-12-09 22:27 ` Paul Eggert
  2014-12-10  3:42   ` Eli Zaretskii
  1 sibling, 1 reply; 6+ messages in thread
From: Paul Eggert @ 2014-12-09 22:27 UTC (permalink / raw)
  To: Eli Zaretskii, emacs-devel

On 12/09/2014 10:09 AM, Eli Zaretskii wrote:
> However, signaling an error in the middle of redisplay is not a good
> idea, because Emacs will immediately re-enter redisplay, again signal
> an error, etc.

Does the code call 'memory_full', or does it signal an error directly?  
If the former, memory_full should free enough spare memory so that the 
redisplay should work and if that's not happening I'd be curious to know 
why.  If the latter, perhaps this should be changed to be the former.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: "memory full" during redisplay
  2014-12-09 22:27 ` Paul Eggert
@ 2014-12-10  3:42   ` Eli Zaretskii
  2014-12-10  6:47     ` Paul Eggert
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2014-12-10  3:42 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel

> Date: Tue, 09 Dec 2014 14:27:16 -0800
> From: Paul Eggert <eggert@cs.ucla.edu>
> 
> On 12/09/2014 10:09 AM, Eli Zaretskii wrote:
> > However, signaling an error in the middle of redisplay is not a good
> > idea, because Emacs will immediately re-enter redisplay, again signal
> > an error, etc.
> 
> Does the code call 'memory_full', or does it signal an error directly?  

The former.  The call to memory is in xmalloc and xrealloc, so it
cannot be avoided.

> If the former, memory_full should free enough spare memory so that the 
> redisplay should work and if that's not happening I'd be curious to know 
> why.

Because that memory reserve is not enough in the use cases I'm talking
about.  The code needs more than just that reserve.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: "memory full" during redisplay
  2014-12-10  3:42   ` Eli Zaretskii
@ 2014-12-10  6:47     ` Paul Eggert
  2014-12-10 16:10       ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Eggert @ 2014-12-10  6:47 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii wrote:
> Because that memory reserve is not enough in the use cases I'm talking
> about.  The code needs more than just that reserve.

How about if we reserve more memory?  That should be a simple change.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: "memory full" during redisplay
  2014-12-10  6:47     ` Paul Eggert
@ 2014-12-10 16:10       ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2014-12-10 16:10 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel

> Date: Tue, 09 Dec 2014 22:47:52 -0800
> From: Paul Eggert <eggert@cs.ucla.edu>
> CC: emacs-devel@gnu.org
> 
> Eli Zaretskii wrote:
> > Because that memory reserve is not enough in the use cases I'm talking
> > about.  The code needs more than just that reserve.
> 
> How about if we reserve more memory?  That should be a simple change.

How will we know how much to reserve?  Eventually, there could be a
request for more than we reserved, and we are back to square one.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-12-10 16:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-09 18:09 "memory full" during redisplay Eli Zaretskii
2014-12-09 22:05 ` Stefan Monnier
2014-12-09 22:27 ` Paul Eggert
2014-12-10  3:42   ` Eli Zaretskii
2014-12-10  6:47     ` Paul Eggert
2014-12-10 16:10       ` Eli Zaretskii

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).