Since 11.0.10 the awesome low-latency ShenandoahGC is officially part of OpenJDK (see $URL), but the ebuild does not enable it. Reproducible: Always Steps to Reproduce: 1. emerge openjdk-11.0.10_p9 2. run /usr/lib64/openjdk-11/bin/java -XX:+UseShenandoahGC 3. not supported :(
Suggested patch: --- /var/db/repos/gentoo/dev-java/openjdk/openjdk-11.0.10_p9.ebuild 2021-02-21 13:42:16.989778500 +0100 +++ openjdk-11.0.10_p9.ebuild 2021-01-22 20:01:30.563803876 +0100 @@ -17,7 +17,7 @@ SRC_URI="https://hg.${PN}.java.net/jdk-u LICENSE="GPL-2" KEYWORDS="~amd64 ~arm ~arm64 ~ppc64" -IUSE="alsa cups debug doc examples gentoo-vm headless-awt javafx +jbootstrap +pch selinux source systemtap" +IUSE="alsa cups debug doc examples gentoo-vm headless-awt javafx +jbootstrap +pch selinux +shenandoah source systemtap" COMMON_DEPEND=" media-libs/freetype:2= @@ -170,6 +170,10 @@ src_configure() { --enable-headless-only=$(usex headless-awt yes no) ) + use shenandoah && myconf+=( + --with-jvm-features=shenandoahgc + ) + if use javafx; then local zip="${EROOT%/}/usr/$(get_libdir)/openjfx-${SLOT}/javafx-exports.zip" if [[ -r ${zip} ]]; then
Is there a good reason why this cannot be added?
no good reason =) just missed the bug. will add shortly. btw, isn't zgc supposed to be better? it's enabled already afaik.
(In reply to Georgy Yakovlev from comment #3) > no good reason =) just missed the bug. > will add shortly. Thanks! > btw, isn't zgc supposed to be better? it's enabled already afaik. They are different (better is not a useful term). The issue is that ZGC in 11 is a very early version (the first I think?) and still immature. Shenandoah is being kept more in sync with mainline via Red Hat & SAP (since they initiated the backport), and has more features like active heap shrinking. Neither G1 nor ZGC in 11 can proactively shrink the heap; that came in (I think) 12. Things are much better and more consistent in 17 where e.g. G1 (the default) is actually useable and not full of weird bugs. It's complicated, at least still in 11. =)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e405b9fedae014f01b724e183154a96305749543 commit e405b9fedae014f01b724e183154a96305749543 Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2022-01-27 21:27:45 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2022-01-27 21:32:19 +0000 dev-java/openjdk: add USE=shenandoahgc to openjdk:11 Closes: https://bugs.gentoo.org/771975 Thanks-to: Holger Hoffstätte <holger@applied-asynchrony.com> Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> dev-java/openjdk/metadata.xml | 1 + dev-java/openjdk/openjdk-11.0.14_p9.ebuild | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) Additionally, it has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5c46048f2210d7e12698ae2187df80200d7dd170 commit 5c46048f2210d7e12698ae2187df80200d7dd170 Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2022-01-27 21:27:02 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2022-01-27 21:32:18 +0000 profiles/arch: unmask openjdk:11[shenandoahgc] on amd64 and arm64 Bug: https://bugs.gentoo.org/771975 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> profiles/arch/amd64/package.use.mask | 5 +++++ profiles/arch/arm64/package.use.mask | 5 +++++ 2 files changed, 10 insertions(+) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9205ab3d9fdc9d5f7363328998f7a2770b175496 commit 9205ab3d9fdc9d5f7363328998f7a2770b175496 Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2022-01-27 21:04:15 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2022-01-27 21:32:18 +0000 profiles/base: mask openjdk[shenandoahgc] Bug: https://bugs.gentoo.org/771975 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> profiles/base/package.use.mask | 5 +++++ 1 file changed, 5 insertions(+)
added, let me know if you see any problems with it. since it's arm64 and amd64 only - I masked it on other arches. openjdk17 already enables it by default on supported arches: amd64 arm64 and ppc64le, so nothing to do there IMO.
(In reply to Georgy Yakovlev from comment #6) > added, let me know if you see any problems with it. > since it's arm64 and amd64 only - I masked it on other arches. Now we have "shenandoah" for icedtea and "shenandoahgc" for 11, not sure what to prefer but two flags seems a bit much. :)
IMHO just enable it unconditionally (just like openjdk-bin-11) and get rid of the flags. There's no harm since it needs to be enabled manually anyway.
I need to check how it reacts to being enabled on arch without support. it can either bail out and fail or silently ignore. but yeah maybe just enable it quietly without flag will work too. but that will be a revision bump, I have more fixes queued, will unload later. as for icedtea I never liked shenandoah, it's a bit confusing. I like matching actual options and a bit more descriptive name tbh.
(In reply to Georgy Yakovlev from comment #9) > I need to check how it reacts to being enabled on arch without support. > it can either bail out and fail or silently ignore. https://github.com/openjdk/jdk11u/blob/22186cb1fe22b4b30fc72c67ce9946cd4f03199d/make/autoconf/hotspot.m4#L355 I think it will just skip it, but better if you can verify.
indeed it skips ( shenandoah was enabled here on ppc64le, but does not show up in enabled features. Configuration summary: * Debug level: release * HS debug level: product * JVM variants: server * JVM features: server: 'cds cmsgc compiler1 compiler2 dtrace epsilongc g1gc jfr jni-check jvmti management nmt parallelgc serialgc services vm-structs' * OpenJDK target: OS: linux, CPU architecture: ppc, address length: 64 * Version string: 11.0.14+9 (11.0.14) Tools summary: * Boot JDK: openjdk version "11.0.14" 2022-01-18 OpenJDK Runtime Environment 11.0.14_p9 (build 11.0.14+9) OpenJDK 64-Bit Server VM 11.0.14_p9 (build 11.0.14+9, mixed mode, sharing) (at /usr/lib64/openjdk-11) * Toolchain: gcc (GNU Compiler Collection) * C Compiler: Version 11.2.0 (at /usr/sbin/powerpc64le-unknown-linux-gnu-gcc) * C++ Compiler: Version 11.2.0 (at /usr/sbin/powerpc64le-unknown-linux-gnu-g++) Build performance summary: * Cores to use: 176 * Memory limit: 519508 MB * ccache status: Disabled
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9133e70715defac1cd873528974a4d3b3eec246b commit 9133e70715defac1cd873528974a4d3b3eec246b Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2022-01-27 23:41:32 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2022-01-27 23:50:43 +0000 profiles: remove openjdk[shenandoahgc] masks/unmasks Bug: https://bugs.gentoo.org/771975 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> profiles/arch/amd64/package.use.mask | 5 ----- profiles/arch/arm64/package.use.mask | 5 ----- profiles/base/package.use.mask | 5 ----- 3 files changed, 15 deletions(-) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3a449787c364378923d07584e09d296dc52d7322 commit 3a449787c364378923d07584e09d296dc52d7322 Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2022-01-27 23:38:00 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2022-01-27 23:50:42 +0000 dev-java/openjdk: update EAPI 6 -> 7, minor improvements Bug: https://bugs.gentoo.org/771975 Also enable shenandoahgc unconditionally. Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> dev-java/openjdk/openjdk-11.0.14_p9-r1.ebuild | 287 ++++++++++++++++++++++++++ 1 file changed, 287 insertions(+)