Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 10, 2026

Comment on lines 174-175 incorrectly stated "200 restarts" when the test uses checkpointInterval = 5.

Changes:

  • Updated comment thresholds to reflect actual 5-restart intervals:
    • With fix: < 5 KB per 5 restarts (was < 2 MB per 200 restarts)
    • Without fix: 10-20 KB per 5 restart interval (was ~3.2 MB per 200 restarts)
  • Now aligns with the 10 KB per-interval assertion threshold
// Assert that Internal category doesn't show super-linear growth
// With fix: Internal should plateau after warmup (< 5 KB per 5 restarts from minor JVM allocations)
// Without fix: line table leaks accumulate → 10-20 KB per 5 restart interval

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

jbachorik and others added 10 commits January 9, 2026 20:15
Fix 1.2GB memory leak in SharedLineNumberTable destructor by adding
proper null checks and error handling for JVMTI Deallocate calls.

Root cause: SharedLineNumberTable destructor was not properly
deallocating JVMTI-allocated line number tables. Customer production
NMT data showed 1.2GB leak from 3.8M GetLineNumberTable allocations.

Changes:
- Add null pointer checks for _ptr and jvmti before deallocation
- Add error handling for Deallocate failures
- Add defensive cleanup in fillJavaMethodInfo for buggy JVMTI impls

Test: GetLineNumberTableLeakTest validates memory plateaus during
steady state with profiler restarts (+1KB vs +20MB leak without fix).

See doc/nmt-jvmti-memory-leak-investigation.md for full analysis.

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Revert GetClassMethods fix - required for AGCT profiling

Revert previous commit that skipped GetClassMethods for JDK 9+.
GetClassMethods must be called to preallocate jmethodIDs for
AsyncGetCallTrace (AGCT), which operates in signal handlers where
lock acquisition is forbidden.

Root cause of 9.2GB memory growth:
- AGCT requires jmethodIDs to be preallocated before profiling
- GetClassMethods triggers JVM-internal jmethodID allocation
- These persist until class unload (necessary for AGCT correctness)
- High class churn = high jmethodID memory usage
- This is NOT a fixable leak - it's inherent to AGCT architecture

Failed fix broke profiling:
- CpuDumpSmokeTest and WallclockDumpSmokeTest failed
- Stack traces incomplete (missing method information)
- AGCT couldn't identify methods without preallocated jmethodIDs

Solution: Accept as cost of signal-safe profiling. Customers can:
1. Reduce class churn (cache generated classes, minimize proxies)
2. Monitor NMT Internal category growth
3. Investigate alternative stack walking (JEP 435, --cstack vm)

See: https://mostlynerdless.de/blog/2023/07/17/jmethodids-in-profiling-a-tale-of-nightmares/

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>

Clarify NMT memory calculations in investigation doc

The NMT #count is number of classes, not individual jmethodIDs.
Each class has 10-20 methods typically, so:
- 9.1M classes × 15 methods = ~136M jmethodIDs
- 9.2GB / 136M = ~68 bytes per jmethodID (reasonable)

This clarifies the misleading '1KB per jmethodID' statement.
Test now checks Internal NMT category (where JVMTI allocations appear)
with profiler restarts and tighter thresholds to catch line table leaks.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Add try-catch blocks around Long.parseLong() calls to properly handle
potential NumberFormatException when parsing NMT output. This addresses
review comments about uncaught exceptions.

The exceptions are now wrapped in IOException with descriptive messages
indicating which NMT category failed to parse.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Copilot AI changed the title [WIP] WIP Address feedback on JVMTI memory leak fix Fix checkpoint interval in GetLineNumberTableLeakTest comment Jan 10, 2026
Copilot AI requested a review from jbachorik January 10, 2026 22:02
@pr-commenter
Copy link

pr-commenter bot commented Jan 10, 2026

Benchmarks [x86_64 wall]

Parameters

Baseline Candidate
config baseline candidate
ddprof 1.34.4 1.35.0-copilot_sub-pr-327-SNAPSHOT
See matching parameters
Baseline Candidate
alloc off off
cpu off off
iterations 5 5
java "11.0.28" "11.0.28"
memleak off off
modes wall wall
wall on on

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 15 metrics, 23 unstable metrics.

@pr-commenter
Copy link

pr-commenter bot commented Jan 10, 2026

Benchmarks [x86_64 cpu]

Parameters

Baseline Candidate
config baseline candidate
ddprof 1.34.4 1.35.0-copilot_sub-pr-327-SNAPSHOT
See matching parameters
Baseline Candidate
alloc off off
cpu on on
iterations 5 5
java "11.0.28" "11.0.28"
memleak off off
modes cpu cpu
wall off off

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 15 metrics, 23 unstable metrics.

@pr-commenter
Copy link

pr-commenter bot commented Jan 10, 2026

Benchmarks [x86_64 memleak]

Parameters

Baseline Candidate
config baseline candidate
ddprof 1.34.4 1.35.0-copilot_sub-pr-327-SNAPSHOT
See matching parameters
Baseline Candidate
alloc off off
cpu off off
iterations 5 5
java "11.0.28" "11.0.28"
memleak on on
modes memleak memleak
wall off off

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 14 metrics, 24 unstable metrics.

@pr-commenter
Copy link

pr-commenter bot commented Jan 10, 2026

Benchmarks [aarch64 wall]

Parameters

Baseline Candidate
config baseline candidate
ddprof 1.34.4 1.35.0-copilot_sub-pr-327-SNAPSHOT
See matching parameters
Baseline Candidate
alloc off off
cpu off off
iterations 5 5
java "11.0.28" "11.0.28"
memleak off off
modes wall wall
wall on on

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 14 metrics, 24 unstable metrics.

@pr-commenter
Copy link

pr-commenter bot commented Jan 10, 2026

Benchmarks [aarch64 cpu,wall]

Parameters

Baseline Candidate
config baseline candidate
ddprof 1.34.4 1.35.0-copilot_sub-pr-327-SNAPSHOT
See matching parameters
Baseline Candidate
alloc off off
cpu on on
iterations 5 5
java "11.0.28" "11.0.28"
memleak off off
modes cpu,wall cpu,wall
wall on on

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 15 metrics, 23 unstable metrics.

@pr-commenter
Copy link

pr-commenter bot commented Jan 10, 2026

Benchmarks [x86_64 memleak,alloc]

Parameters

Baseline Candidate
config baseline candidate
ddprof 1.34.4 1.35.0-copilot_sub-pr-327-SNAPSHOT
See matching parameters
Baseline Candidate
alloc on on
cpu off off
iterations 5 5
java "11.0.28" "11.0.28"
memleak on on
modes memleak,alloc memleak,alloc
wall off off

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 15 metrics, 23 unstable metrics.

@pr-commenter
Copy link

pr-commenter bot commented Jan 10, 2026

Benchmarks [x86_64 cpu,wall,alloc,memleak]

Parameters

Baseline Candidate
config baseline candidate
ddprof 1.34.4 1.35.0-copilot_sub-pr-327-SNAPSHOT
See matching parameters
Baseline Candidate
alloc on on
cpu on on
iterations 5 5
java "11.0.28" "11.0.28"
memleak on on
modes cpu,wall,alloc,memleak cpu,wall,alloc,memleak
wall on on

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 15 metrics, 23 unstable metrics.

@pr-commenter
Copy link

pr-commenter bot commented Jan 10, 2026

Benchmarks [aarch64 cpu,wall,alloc,memleak]

Parameters

Baseline Candidate
config baseline candidate
ddprof 1.34.4 1.35.0-copilot_sub-pr-327-SNAPSHOT
See matching parameters
Baseline Candidate
alloc on on
cpu on on
iterations 5 5
java "11.0.28" "11.0.28"
memleak on on
modes cpu,wall,alloc,memleak cpu,wall,alloc,memleak
wall on on

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 17 metrics, 21 unstable metrics.

@pr-commenter
Copy link

pr-commenter bot commented Jan 10, 2026

Benchmarks [aarch64 cpu]

Parameters

Baseline Candidate
config baseline candidate
ddprof 1.34.4 1.35.0-copilot_sub-pr-327-SNAPSHOT
See matching parameters
Baseline Candidate
alloc off off
cpu on on
iterations 5 5
java "11.0.28" "11.0.28"
memleak off off
modes cpu cpu
wall off off

Summary

Found 1 performance improvements and 0 performance regressions! Performance is the same for 15 metrics, 22 unstable metrics.

scenario Δ mean execution_time Δ mean rss
scenario:renaissance:scala-doku better
[-4.651s; -1.621s] or [-15.292%; -5.330%]
unstable
[-192.319MB; +285.541MB] or [-18.168%; +26.975%]

@pr-commenter
Copy link

pr-commenter bot commented Jan 10, 2026

Benchmarks [aarch64 memleak,alloc]

Parameters

Baseline Candidate
config baseline candidate
ddprof 1.34.4 1.35.0-copilot_sub-pr-327-SNAPSHOT
See matching parameters
Baseline Candidate
alloc on on
cpu off off
iterations 5 5
java "11.0.28" "11.0.28"
memleak on on
modes memleak,alloc memleak,alloc
wall off off

Summary

Found 1 performance improvements and 0 performance regressions! Performance is the same for 14 metrics, 23 unstable metrics.

scenario Δ mean execution_time Δ mean rss
scenario:renaissance:akka-uct better
[-1.995s; -0.645s] or [-6.482%; -2.095%]
unstable
[-242.325MB; +285.047MB] or [-19.479%; +22.913%]

@pr-commenter
Copy link

pr-commenter bot commented Jan 10, 2026

Benchmarks [aarch64 alloc]

Parameters

Baseline Candidate
config baseline candidate
ddprof 1.34.4 1.35.0-copilot_sub-pr-327-SNAPSHOT
See matching parameters
Baseline Candidate
alloc on on
cpu off off
iterations 5 5
java "11.0.28" "11.0.28"
memleak off off
modes alloc alloc
wall off off

Summary

Found 1 performance improvements and 0 performance regressions! Performance is the same for 15 metrics, 22 unstable metrics.

scenario Δ mean execution_time Δ mean rss
scenario:renaissance:scala-doku better
[-5.237s; -2.515s] or [-17.219%; -8.269%]
unstable
[-195.132MB; +276.979MB] or [-18.328%; +26.016%]

@pr-commenter
Copy link

pr-commenter bot commented Jan 10, 2026

Benchmarks [aarch64 memleak]

Parameters

Baseline Candidate
config baseline candidate
ddprof 1.34.4 1.35.0-copilot_sub-pr-327-SNAPSHOT
See matching parameters
Baseline Candidate
alloc off off
cpu off off
iterations 5 5
java "11.0.28" "11.0.28"
memleak on on
modes memleak memleak
wall off off

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 16 metrics, 22 unstable metrics.

@pr-commenter
Copy link

pr-commenter bot commented Jan 10, 2026

Benchmarks [x86_64 alloc]

Parameters

Baseline Candidate
config baseline candidate
ddprof 1.34.4 1.35.0-copilot_sub-pr-327-SNAPSHOT
See matching parameters
Baseline Candidate
alloc on on
cpu off off
iterations 5 5
java "11.0.28" "11.0.28"
memleak off off
modes alloc alloc
wall off off

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 16 metrics, 22 unstable metrics.

@pr-commenter
Copy link

pr-commenter bot commented Jan 10, 2026

Benchmarks [x86_64 cpu,wall]

Parameters

Baseline Candidate
config baseline candidate
ddprof 1.34.4 1.35.0-copilot_sub-pr-327-SNAPSHOT
See matching parameters
Baseline Candidate
alloc off off
cpu on on
iterations 5 5
java "11.0.28" "11.0.28"
memleak off off
modes cpu,wall cpu,wall
wall on on

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 16 metrics, 22 unstable metrics.

@jbachorik jbachorik force-pushed the jb/linenumber_leak branch 3 times, most recently from 73aadd8 to cd0c279 Compare January 12, 2026 11:01
@jbachorik jbachorik closed this Jan 12, 2026
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.

2 participants