Re:Conservative GC: Is It Really That Bad?
by dbg_nsk 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!
Stack maps can be made a bit smaller by pushing and popping all registers from the stack during gc. That way, you only need to store the values of stack locations in them and not of individual registers.
Btw, the article is really good. This is the kind of stuff I keep coming back to HN for!