
Erlang 19.0 Garbage Collector - bandris
https://www.erlang-solutions.com/blog/erlang-19-0-garbage-collector.html
======
rdtsc
Very well done article.

Release 19.0 is looking exciting, other things they seem to be planning on
(this is mainly from Erlang Factory 2016 Slides):

* 10x faster tracing

* Dirty schedulers turned on by default

* A new state machine OTP module

* An external plugin (with LevelDB as one example) for Mnesia storage

* 2x-3x faster spawning external processes + many others

18.0 brought fast maps, good time handling. It is exciting to see all this
good stuff done in a 30 year old language.

~~~
wcummings
Erlang is getting cool new features so fast it's hard to keep up. It's a nice
problem to have :)

------
stingraycharles
The Erlang garbage collector is a fascinating topic; here is a discussion on
HN about it:

[https://news.ycombinator.com/item?id=10218343](https://news.ycombinator.com/item?id=10218343)

------
davidw
Sort of a meta note: it's interesting how some of the really technical
articles get a ton of votes, but not many comments.

Very interesting in any case, and I certainly voted for it - I'd love to see
more articles like this.

~~~
Pxtl
I get the impression that Erlang is one of those languages we all wish we had
the time to really dive deep into but never will. Same as Rust. So it gets
upvotes.

~~~
davidw
I used it at the last place I worked. It was a great fit for what we were
doing (a semi-embedded device).

~~~
dikaiosune
How embedded was "semi-embedded"? I ask because I'm on a project for which we
had discussed using Erlang or Elixir but decided the VM overhead was too high
to support all our uses.

~~~
jerf
Well, Erlang's been around for like 30 years. What was a pretty powerful
computer back then is something we'd call "embedded" today. Of course, we
still call things with 8-bit processors and single-digit kilobytes of RAM
embedded, too. So it depends on where you fall in that scale. The phone
switches it was designed to run are also fairly low-power devices by modern
standards. (Lots and lots and LOTS of custom hardware, but not necessarily a
lot of "CPU".)

In addition to what the article itself talks about, there's a number of other
memory knobs you can twiddle for various use cases.

~~~
rdtsc
I apply that term more liberally, it not much as about size of CPU or RAM but
more about how it is indented to be used.

Is the user expected to know about OS packages on it. Are they
installing/updating software components by hand, so they know the OS version
which runs in the box even, are they calling it a "server"? If the answer is
yes, it not "embedded".

If they interact with the device as with an appliance (a dvd player,
microwave, car infotainment center, some radio base station and so on), then
it is embedded. It can still be an 8 core Xeon monster, but because of how it
is serviced and used it, I think of it as embedded.

~~~
davidw
Once again, exactly: the device in question was not severely CPU or memory
constrained or anything, but the user treated it more like an appliance than
like a computer. Also had some real-time-ish stuff that was mostly handled in
C++.

------
Ixiaus
This is very exciting. We use Erlang in an embedded environment and 19.0 will
be a valuable release for us.

------
bjourne
I wonder if the remaining processes can keep running while one is collecting?
It looks like when collection of the old generation is running, then all
processes in the VM must first be stopped. That is a drag for concurrency.

~~~
cpeterso
Each Erlang process has its own heap that can be GC'd in parallel, plus a
shared global heap.

~~~
toast0
Just for future people who see this: the shared binary heap is not garbage
collected, it's reference counted. When the process heap is GC'ed any
references to the binary heap that didn't survive GC will be removed and
refcounts updated. (Also when a process exits, all the binary heap references
will be updated)

------
liveoneggs
hopefully opening unix sockets is also allowed in 19

~~~
mononcqc
You may want to use the procket library:
[https://github.com/msantos/procket/](https://github.com/msantos/procket/)

