Skip to content

Support for Shenandoah GC #3472

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rkennke opened this issue Jun 14, 2021 · 8 comments
Open

Support for Shenandoah GC #3472

rkennke opened this issue Jun 14, 2021 · 8 comments
Assignees

Comments

@rkennke
Copy link
Contributor

rkennke commented Jun 14, 2021

The Graal compiler currently does not support the Hotspot Shenandoah GC. Shenandoah GC is relevant in situations where latency is a concern, because it drastically reduces GC pause times. This is not only relevant in large-heap settings where GC tends to take a long time due to the size of live data that needs to be marked and relocated, but also in resource-constrained environment where even relatively little STW-work can balloon.

A first step in supporting Shenandoah GC in Graal compiler would be to implement the basic Shenandoah barriers:

  • Load-reference barrier to be employed after loading references
  • SATB-barrier to be employed before reference writes (very similar to G1's SATB barrier)
  • CAS-obj barrier that handle Unsafe.compareAndSwapReference() and related methods
  • Arraycopy barrier to deal with arraycopies of Object[]
  • Reference.get() barrier

This would be enough to support Graal compiler in JDK 11. However, additional features have been added between JDK 11 and JDK 17, which require extra work:

  • Concurrent class-unloading requires so-called nmethod-barriers: little pieces of GC code to be called when calling into 'armed' nmethods (and a mechanism to arm nmethods).
  • Concurrent thread-scanning which requires stack-watermark support.

Both these features are not Shenandoah specific. For example, ZGC would also make use of them.

Much of the first step (JDK 11 support) is implemented in #2426.

@munishchouhan
Copy link
Contributor

@dougxc please advise

@rkennke
Copy link
Contributor Author

rkennke commented Jun 16, 2021

Notice that this is mostly informational for now. We recently had a discussion with @thomaswue were we agreed that I file this issue to collect TODOs and a rough outline, also with an eye on possibly supporting Shenandoah in native-image.

@dougxc
Copy link
Member

dougxc commented Jan 23, 2024

I'm closing this issue due to lack of activity. Please re-open it (and reassign) when/if there are plans to make progress on adding Shenandoah to Native Image.

@dougxc dougxc closed this as completed Jan 23, 2024
@bric3
Copy link

bric3 commented Jan 24, 2024

@dougxc I don't think this issue is related to Shenandoah on the native image but on the Graal Compiler.

@dougxc
Copy link
Member

dougxc commented Jan 24, 2024

Ah yes, thanks for pointing that out. Still, the issue will remain closed until further plans are made for supporting Shenandoah in Graal (in any config).

@reneleonhardt
Copy link

reneleonhardt commented Jul 25, 2024

It's sad that there is no progress after 3 years, switching from G1 to Shenandoah massively reduced our spring-web latency.

@JohnTortugo
Copy link
Contributor

Please, re-open this issue. I'm resuming @rkennke work on this patch.

@zakkak zakkak reopened this Jan 28, 2025
@rkennke
Copy link
Contributor Author

rkennke commented Apr 15, 2025

I cannot seem to assign this back to me. I'm currently working on it, WIP PR is here: #10904

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants