[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [EXPERIMENT] Emacs with the SpiderMonkey garbage collector
From: |
Stefan Monnier |
Subject: |
Re: [EXPERIMENT] Emacs with the SpiderMonkey garbage collector |
Date: |
Sun, 26 Nov 2017 00:11:01 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
>> But it's not like it doesn't have downsides.
> ... and then you stopped writing! Just when you were getting to the good part!
Off the top of my head:
- `sxhash-eq` is a lot more painful to implement.
- during GC you need *double* the heap space. If you only GC a sub-part
of your heap (e.g. just one generation), then you only need double
that sub-part. So if you only use a copy-GC for the youngest generation
it's not a big deal, but if you use stop© over your whole heap,
we're talking about a 100% overhead on memory usage.
- interaction with C code is significantly more tricky since you really
need to find *all* the pointers into your objects, including random
transient ones that aren't Lisp_Object.
Often, the only sane way out is to disallow access to the actual
pointers from C: e.g. the C code only manipulates "handles" into an
array of actual pointers.
- the most obvious concurrent-GC for stop© requires a read-barrier
rather than a write-barrier.
But I do recommend taking a look at the TI Explorer II's garbage
collector, described in the article below. It's making a really neat
use of the read-barrier!
Stefan
@Article{Courts88,
author = {Robert Courts},
title = {Improving locality of reference in garbage-collecting
memory management system},
journal = CACM,
year = 1988,
volume = 31,
number = 9,
pages = {1128-1138},
doi = {http://doi.acm.org/10.1145/48529.48536},
xnote = {TI Explorer II's GC!!},
abstract = {Modern Lisp systems make heavy use of a garbage-collecting
style of memory management. Generally, the locality of
reference in garbage-collected systems has been very poor.
In virtual memory systems, this poor locality of reference
generally causes a large amount of wasted time waiting on
page faults or uses excessively large amounts of main
memory. An adaptive memory management algorithm,
described in this article, allows substantial improvement
in locality of reference. Performance measurements
indicate that page-wait time typically is reduced
by a factor of four with constant memory size and disk
technology. Alternately, the size of memory typically can
be reduced by a factor of two with constant performance.}
}
- Re: [EXPERIMENT] Emacs with the SpiderMonkey garbage collector, (continued)
Re: [EXPERIMENT] Emacs with the SpiderMonkey garbage collector, Stefan Monnier, 2017/11/24
Re: [EXPERIMENT] Emacs with the SpiderMonkey garbage collector, martin rudalics, 2017/11/26