K
Keith Thompson
W Marsh said:Go on then - I would like to know how garbage collection affects
real-time systems. A good reason, showing thought and reason. In other
words, show us that you're not just full of shit.
Bear in mind that garbage collection shouldn't affect the behaviour of
a system, only its constraints.
My understanding is that typical garbage collection systems
occasionally through periods of intense activity to gather information
about memory that can be reclaimed. It's difficult or impossible to
predict when these periods will occur or how much CPU time they'll
take. The result can be a missed deadline, which is unacceptable in a
hard real-time system.
* Exactly how precise do you think a toaster timer needs to be?
I don't know, but if you can't guarantee a reasonable upper bound on
any unpredictable delays, you could end up with burned toast or worse.
Possibly garbage collection could be safely used in a toaster, but I
wouldn't use it in a real safety-critical system. (And how much
dynamic memory allocation does a toaster need to do?)
I'm not an expert on either garbage collection or real-time systems.
Feel free to correct me if I'm mistaken.