emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Garbage collector: is 800kb a good default?


From: Dmitrii Korobeinikov
Subject: Re: Garbage collector: is 800kb a good default?
Date: Thu, 9 Apr 2020 20:46:53 +0600

> The "right" value depends on your usage patterns, among other
> factors.  How to account for that in the default value?

I am not sure what you mean exactly by usage patterns.

> Let's not forget that running GC while Emacs is idle will make Emacs
> less responsive if the user starts typing while GC is in progress,
> specially if gc-cons-threshold is high.  So it isn't entirely "free".

Maybe it would be possible to garbage collect in chunks and check
after each chunk for input?

Best,
DK

чт, 9 апр. 2020 г. в 20:02, Eli Zaretskii <address@hidden>:
>
> > From: Dmitrii Korobeinikov <address@hidden>
> > Date: Thu, 9 Apr 2020 19:44:40 +0600
> > Cc: emacs-devel <address@hidden>
> >
> > > Two things: (1) the timer will not run as long as Emacs is running
> > > some prolonged calculation, which could produce a lot of garbage; and
> >
> > True, that's a reason for not making it too high. Emacs would also
> > freeze very noticably in those cases. But I think the threshold
> > doesn't have to be very high to reap most of the the benefits. For
> > example, I am testing 80MB at the moment. Pretty sure I would be
> > satisfied with half that. By satisfied I mean 3.5k lines of scroll
> > action would still be plenty (before a ~1/3-1/2 second gc freeze
> > happens) and the startup time would be shaved off quite close to the
> > apparent limit anyway.
>
> The "right" value depends on your usage patterns, among other
> factors.  How to account for that in the default value?
>
> > > (2) you seem to ignore the increased memory pressure on the rest of
> > > the system from the growing memory footprint of Emacs.  On GNU/Linux,
> > > Emacs doesn't really return malloc'ed memory to the system, so once
> > > the memory footprint grows, it more or less stays that way even after
> > > GC.
> >
> > Didn't know about that. A ground of reasoning here could be what the
> > average user would see as acceptable. Of course, there are also people
> > who optimize their system for memory consumption. But they are
> > probably tech-savvy enough to find the gc options anyway.
>
> The effect also depends on how much VM does the user have on his/her
> system, and what other applications routinely run there.  Since we are
> talking about defaults, we should find a setting that is safe,
> i.e. works for everyone.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]