newrelic / newrelic/newrelic-java-agent
[Spike] Audit use of NewField annotations in instrumentation modules
Open
@sharvath-newrelic is already working on this.
Since Sep 17, 2026.
- Dominant language
- Java
- Stars
- 240
- Forks
- 170
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 21
Description
We discovered that in some high throughput scenarios the usage of NewField annotations in our weave instrumentation classes can cause contention with the underlying caffeine cache that holds them and lead to high memory usage (with similar characteristics to a memory leak, though technically not a leak).
We recently undertook some work to remove the NewField annotations from two of the most impacted instrumentation modules:
- JDBC: https://github.com/newrelic/newrelic-java-agent/issues/2936
- Log4j: https://github.com/newrelic/newrelic-java-agent/pull/2917
The goal of this issue is to:
- Audit all other uses of
NewFieldannotations in instrumentation modules - Determine which ones may be the most impactful
- Create an issue for the high impact instrumentation modules to explore the feasibility of removing the
NewFieldannotations from them
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.