Skip to content

fix(mc): resolve JVM GC conflict — disable Aikar flags, use ZGC#9895

Merged
h0lybyte merged 2 commits intodevfrom
trunk/mc-jvm-fix-1775771243
Apr 9, 2026
Merged

fix(mc): resolve JVM GC conflict — disable Aikar flags, use ZGC#9895
h0lybyte merged 2 commits intodevfrom
trunk/mc-jvm-fix-1775771243

Conversation

@h0lybyte
Copy link
Copy Markdown
Member

@h0lybyte h0lybyte commented Apr 9, 2026

Summary

MC server crashes immediately with Multiple garbage collectors selected:

  • USE_AIKAR_FLAGS=true sets G1GC via Aikar's JVM flags
  • JVM_XX_OPTS adds ZGC on top
  • JVM refuses to start with two GCs

Fix: Disable Aikar flags, keep ZGC with generational mode + tuning flags (AlwaysPreTouch, DisableExplicitGC, ParallelRefProcEnabled). ZGC has lower pause times than G1GC for MC servers.

Test plan

  • JVM starts without GC conflict
  • Fabric server loads all mods
  • Server accepts player connections on 1.21.11

Aikar flags set G1GC + JVM_XX_OPTS set ZGC = "Multiple garbage
collectors selected" crash on startup. Disable Aikar flags and
use ZGC with generational mode + tuning flags instead.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 9, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 08efb47.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

- Set ONLINE_MODE=false in e2e container — no Mojang auth needed
- Add early JVM GC conflict detection in wait loop — fails fast
  instead of waiting 300s for a server that will never start
- Enable has_test: true + e2e_name in mc.mdx so CI runs e2e before
  publishing, preventing broken images from reaching production
@h0lybyte h0lybyte merged commit 6d0f863 into dev Apr 9, 2026
1 check passed
@h0lybyte h0lybyte deleted the trunk/mc-jvm-fix-1775771243 branch April 9, 2026 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant