News for hackers. Stuff that matters.

dbg_nsk

Re:Conservative GC: Is It Really That Bad? on Thursday February 22, 2018 @11:03PM (#16444122)
Right, but even a single instruction placed on every backward branch and at the epilogue of every method causes noticeable impact on the performance. This is especially important in highly optimized code and that's why optimizing compilers like HotSpot C2 (and JET as well) try to remove as many safepoints as possible. Sometimes it even causes troubles like in this case:

https://bugs.openjdk.java.net/browse/JDK-5014723

Good point about inspecting thread's callstack. Indeed, with conservative GC we had a problem: many popular profilers were incompatible with JET because they inspect threads at safepoints and we had none. When we implemented the precise GC, this problem disappeared and it was an additional benefit for us. However, there are alternative ways to gather thread's callstack out of safepoint. We use them to avoid safepoint bias in our profiler. You can read more about it here:

https://www.excelsiorjet.com/blog/articles/portable-profiler...

----

Thanks for kind words! I'm glad that you liked the post!

Re:Conservative GC: Is It Really That Bad? on Thursday February 22, 2018 @03:39PM (#16441167)
It would be very interesting to run our sample with Timers on this GC. In that paper I found a link to their implementation, but unfortunately it is unavailable.
Re:Conservative GC: Is It Really That Bad? on Thursday February 22, 2018 @02:31PM (#16440632)
Yes, I wrote this article.

No, I haven't read those papers before, but after your comment I took a look at one of them.. and it is very interesting! Thanks for mentioning it.

But, if I understood correctly, the excess memory retention is still a problem in conservative immix?

Re:Conservative GC: Is It Really That Bad? on Thursday February 22, 2018 @10:43AM (#16438285)
You are right, such things as value types or inline arrays are not introduced in Java language (yet), but still JVM can allocate objects including arrays on the stack if this objects are not escaping into the heap. Of course, not all objects fit this condition, but the problem remains.
Re:Conservative GC: Is It Really That Bad? on Thursday February 22, 2018 @10:20AM (#16438102)
Yes, an excellent point. Unfortunately, we do not have such specific benchmarks at the moment (only general benchmarks on the performance of GC), but I guess we should add them.

However, please note, that our conservative GC was also copying (but not full copying) collector, and it also improved locality of references. So an impact on the performance is not so huge as in the case of GC that doesn't provide any compaction at all.

Re:Conservative GC: Is It Really That Bad? on Thursday February 22, 2018 @07:57AM (#16437211)
Yeah, we've tried that. It was one of the attempts of improving conservative GC (no dead values on the stack => no false roots). Unfortunately, it causes noticeable performance degradation, so it is easier to consult with stack maps about liveness of the variable.
Re:Conservative GC: Is It Really That Bad? on Thursday February 22, 2018 @07:41AM (#16437138)
Absolutely agree with you about finalizers! However, please note that this "threadReaper" code is from JDK class, so, the problem can appear on every application that just use Timer class.

Of course, there are many other examples of false-roots, but this concrete class caused unexpected OOMs on several applications of our clients, so we made this small sample and used it for sanity checking during implementing precise GC (and then mentioned it in the post).

Re:Conservative GC: Is It Really That Bad? on Thursday February 22, 2018 @07:10AM (#16436994)
The problem is that it all depends on the liveness of the variables. The same value on the stack can be a root at the begining of the method as the corresponding variable is still alive, and later it becomes useless as the variable is already dead. So, you still need to know a location of each live reference at every safepoint (and that means several stack-maps for each method).
Re:Portable Profilers and Where to Find Them on Thursday September 28, 2017 @10:36AM (#15357381)
hi, feel free to ask me any questions about the post