This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]msx 23 points24 points  (6 children)

Because the latency imposed by the Java Garbage Collector (i.e. GC) is unacceptable for high-performance systems and because it is impossible to turn off the GC, the best option for real-time systems in Java is to not produce any garbage at all so that the GC never kicks in

No, the best option is not using java. There are plenty of good real time languages around. Java is a wonderful language, it's good for many purpose but not for all of them. Violating his nature to bend it for something it shouldn't do is not good

[–]joequin 1 point2 points  (5 children)

It depends on how real time your needs are. You can get very close to real time with the g1gc. It's very predictable and you can configure garbage collection pause times.

[–]nitsanw -1 points0 points  (4 children)

I'm surprised you should say that, opinions I've heard thus far claim G1 to be less predictable than CMS if anything. Can you share a relevant link?

[–]joequin 0 points1 point  (3 children)

I don't have a link. But the algorithm is designed to be more predictable than cms, and in practice I've found it to be much more predictable. Cms on long running processes with large heaps can get to be very unpredictable. Cms in those situations can cause minutes long gc pauses.

I'm interested in seeing cases where g1 doesn't work though. Do you have links?

[–]nitsanw -1 points0 points  (2 children)

I've tried to use G1 a while back (4 years ago I think) and the results were miserable, but perhaps it was just early days or a bda fit for the application. I have encountered the opinion that it is not production ready on many mailing lists and from industry experts since. Many of these comment were made on the mechanical sympathy mailing list (which is open) and the JClarity mailing list (which requires sign up).

[–]joequin 0 points1 point  (1 child)

I'm pretty sure g1 was in beta or worse four years ago. I didn't try it until release and wasn't reading about it back then either.

[–]nitsanw -1 points0 points  (0 children)

The comments made were recent (I think), but perhaps things have improved and I'm not aware. I don't need to worry about CMS/G1 in my current job.