#134 baseline with ZGC, sample retry on gc, gc hint options#143
Merged
jamesmarkchan merged 21 commits intodevfrom Mar 2, 2026
Merged
#134 baseline with ZGC, sample retry on gc, gc hint options#143jamesmarkchan merged 21 commits intodevfrom
jamesmarkchan merged 21 commits intodevfrom
Conversation
- Add GcDetector.java: detects JVM GC events via GarbageCollectorMXBean notifications - Modify BenchmarkRunner: retry sample up to MAX_GC_RETRIES (3) when GC detected - Add gcRetryEnabled option to App, BenchmarkConfig, and RunBenchmarkCommand (--gc-retry) - Set run.jvmargs=-XX:+UseZGC in project.properties to enable Generational ZGC Co-authored-by: jamesmarkchan <6020424+jamesmarkchan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement solution for issue #134 on gen zgc configuration
Implement Generational ZGC configuration and GC-aware sample retry (#134)
Feb 26, 2026
Member
|
I've updated the issue description |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to reduce benchmark noise caused by GC pauses by (1) running with ZGC by default in project/packaging configs and (2) adding an opt-in mechanism to detect GC during a sample and retry that sample.
Changes:
- Added a
GcDetectorthat listens for GC JMX notifications, plus atriggerAndWait()helper for GC “hinting”. - Added per-sample GC-detection retry logic to
BenchmarkRunnerbehind a newgcRetryEnabledflag (wired through CLI + GUI + persisted config). - Updated run/packaging configs (NetBeans, Ant/jpackage, Debian wrapper) to pass
-XX:+UseZGC; added a GitHub Actions DEB build workflow.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/jdiskmark/RunBenchmarkCommand.java |
Adds --gc-retry / -g CLI flag and persists it into App.gcRetryEnabled. |
src/jdiskmark/MainFrame.java |
Adds GUI menu toggles for GC hints and GC retry, persisted via App.saveConfig(). |
src/jdiskmark/MainFrame.form |
NetBeans form updates for the new menu items. |
src/jdiskmark/GcDetector.java |
New class to detect GC events + provide GC hinting helper (triggerAndWait()). |
src/jdiskmark/BenchmarkRunner.java |
Adds GC-aware retry loop and optional GC hinting calls around benchmark phases. |
src/jdiskmark/BenchmarkConfig.java |
Adds gcRetryEnabled and gcHintsEnabled to the benchmark config snapshot. |
src/jdiskmark/App.java |
Adds persisted config keys for GC retry/hints, and injects them into BenchmarkConfig. |
pkg/ubuntu/symlink/postinst |
Enhances DEB post-install to create a desktop entry and update desktop database. |
nbproject/project.properties |
Sets NetBeans run JVM args to -XX:+UseZGC. |
build.xml |
Adds --java-options for jpackage/DEB launcher and sets a default jvm.run.options=-XX:+UseZGC. |
.github/workflows/linux-build.yml |
New workflow to build/upload DEB artifacts using Ant on Ubuntu. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
) - Default gcRetryEnabled to false (was incorrectly true) - Compensate progress counters on GC retry: subtract config.numBlocks from writeUnitsComplete/readUnitsComplete before each retry to cancel block-level increments from the failed attempt - Fix getGlobalGcCount() to count all GC collectors when no ZGC "Cycles" beans are present, avoiding 2s timeout on G1/Parallel GC Co-authored-by: jamesmarkchan <6020424+jamesmarkchan@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…configure-gen-zgc-sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GcDetector.java- utility class to detect GC events viaGarbageCollectorMXBeannotificationsBenchmarkRunner.java- add GC detection and sample retry logic (up to MAX_GC_RETRIES=3)App.java-gcRetryEnableddefaults tofalse(opt-in, not opt-out)BenchmarkConfig.java- addgcRetryEnabledfield (primitiveboolean)nbproject/project.properties- setrun.jvmargs=-XX:+UseZGCto enable Generational ZGC--gc-retryCLI option toRunBenchmarkCommand.javaGcDetector.getGlobalGcCount()to work with all GC collectors (not just ZGC "Cycles" beans)💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.