6

Generally GC is not a good choice to get a soft real-time attribute. But Erlang is GC based language can be soft real-time.

Does it mean Erlang have almost no GC latency? How does it work?

9
  • 2
    Even the hard real-time garbage collectors exists. E.g., lambda-the-ultimate.org/node/2393 Commented Apr 24, 2012 at 15:20
  • @SK-logic I agree that there're some RTGC implementations. Anyway I have a big question; How can you guarantee collection workload distribution where you cannot know the collection timing? Commented Dec 4, 2014 at 16:36
  • you should not care about collection timing - the only requirement that it never ever blocks your RT processes. Commented Dec 4, 2014 at 17:33
  • @SK-logic My question comes from concern about memory pressure. If it guarantees fully distributed (over time) small collections, sometimes heavy collection workload will be deferred, and program may create more garbages while it has been deferred. If this continues, memory can be exhausted in short period. Naive GC solves this by performing eventual full GC, but it is impossible in RTGC. Then I have to tune garbage generation to fit to the GC distribution algorithm, but how can I guarantee (because it's RT) proper workload distribution without knowing GC timing...? Commented Dec 5, 2014 at 3:10
  • 1
    I mean that if there is a known constant throughput of the garbage collector, with a known time in between epochs, you can, potentially, statically prove that your allocation rate do not exceed this threshold. Not sure if anyone is doing this in practice. Commented Dec 5, 2014 at 15:54

1 Answer 1

12

Erlang processes don't share memory, each one has its own heap and they can be garbage-collected independently.

Many small heaps result in many small GC-pauses, rather than few big ones.

1
  • 2
    Here's great write-up on Erlang's GC (which includes your point and makes a few others): prog21.dadgum.com/16.html Commented Aug 5, 2012 at 1:27

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.