feat: add advanced profiling and correlation analysis (Phase 3-5)#21
Merged
feat: add advanced profiling and correlation analysis (Phase 3-5)#21
Conversation
Phase 3: GC Deep Dive - Add allocation rate tracking (jdk.ObjectAllocationInNewTLAB) - Add metaspace monitoring (jdk.MetaspaceSummary) - Add GC overhead calculation with warnings Phase 4: CPU/Thread Deep Dive - Add method profiling via execution sampling (jdk.ExecutionSample) - Add lock contention analysis (jdk.JavaMonitorEnter/Wait) Phase 5: Correlation Analysis - Add GC ↔ CPU spike correlation detection - Add GC ↔ Pinning correlation detection - Add automatic recommendations (memory leak, contention hotspots, etc.) New API endpoints: - /allocation-analysis - /metaspace-metrics - /method-profiling - /contention-analysis - /correlation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix CorrelationAnalyzer constructor call (no args) - Pass correlationAnalyzer to EventBroadcaster Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- allocation.enabled: true -> false (can generate millions of events) - allocation.threshold: 1KB -> 1MB (higher threshold reduces events) - contention.enabled: true -> false (opt-in feature) - contention.threshold: 10ms -> 50ms (reduces noise) These features have high overhead and should be explicitly enabled. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Change heap from 128MB to 512MB - JFR + Netty + app requires more memory than 128MB Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- allocation.enabled: false (was true) - allocation.threshold: 1MB (was 1KB) - contention.enabled: false (was true) - contention.threshold: 50ms (was 10ms) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add jdk.ObjectAllocationOutsideTLAB event capture - Large objects (>TLAB size) are allocated outside TLAB and were not being tracked, causing allocation analysis to show 0 despite heavy allocation activity - Both TLAB and outside-TLAB events now use same handler - Update docs with advanced profiling overhead information - Add runMetricsDemoFull gradle task for full profiling demo Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.
Summary
This PR implements Phase 3-5 of the Argus JVM Profiler expansion plan:
Phase 3: GC Deep Dive
jdk.ObjectAllocationInNewTLAB, identify top allocating classesjdk.MetaspaceSummaryPhase 4: CPU/Thread Deep Dive
jdk.ExecutionSample(configurable sampling interval)jdk.JavaMonitorEnterandjdk.JavaMonitorWaitPhase 5: Correlation Analysis
New Files (13)
argus-core:
AllocationEvent.java- TLAB allocation event recordMetaspaceEvent.java- Metaspace usage event recordExecutionSampleEvent.java- CPU profiling sample recordContentionEvent.java- Lock contention event recordargus-agent:
AllocationEventExtractor.java- JFR allocation extractorMetaspaceEventExtractor.java- JFR metaspace extractorExecutionSampleExtractor.java- JFR execution sample extractorContentionEventExtractor.java- JFR contention extractorargus-server:
AllocationAnalyzer.java- Allocation rate analysisMetaspaceAnalyzer.java- Metaspace trackingMethodProfilingAnalyzer.java- Hot methods analysisContentionAnalyzer.java- Lock contention analysisCorrelationAnalyzer.java- Cross-metric correlationNew API Endpoints
/allocation-analysis/metaspace-metrics/method-profiling/contention-analysis/correlationNew Configuration Options
argus.allocation.enabledtrueargus.allocation.threshold1024argus.metaspace.enabledtrueargus.profiling.enabledfalseargus.profiling.interval20argus.contention.enabledtrueargus.contention.threshold10argus.correlation.enabledtrueTest plan
./gradlew build🤖 Generated with Claude Code