Skip to content
This repository has been archived by the owner on Dec 23, 2023. It is now read-only.

Commit

Permalink
Cherrypick #2043 into V0.27.x (#2055)
Browse files Browse the repository at this point in the history
* Remove finalize from RecordEventsSpanImpl (#2043)

Fixes #2045

This will reduce GC pressure since the VM will not call
Finalizer.register() when creating Span objects.

Since this method is synchronized on a static lock
it can be a source of contention.

It also avoids contention on the same lock when running
runFinalizer() as part of GC

(cherry picked from commit eab6382)

* Bump version to 0.27.1

* Bump version to 0.27.2-SNAPSHOT

* Bump version to 0.27.1

* Bump version to 0.27.2-SNAPSHOT
  • Loading branch information
zoercai committed Sep 25, 2020
1 parent f90e098 commit 48816c8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
1 change: 0 additions & 1 deletion buildscripts/checkstyle.xml
Expand Up @@ -173,7 +173,6 @@
<message key="name.invalidPattern"
value="Interface type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="NoFinalizer"/>
<module name="GenericWhitespace">
<message key="ws.followed"
value="GenericWhitespace ''{0}'' is followed by whitespace."/>
Expand Down
Expand Up @@ -586,15 +586,4 @@ private RecordEventsSpanImpl(
timestampConverter != null ? timestampConverter : TimestampConverter.now(clock);
startNanoTime = clock.nowNanos();
}

@SuppressWarnings("NoFinalizer")
@Override
protected void finalize() throws Throwable {
synchronized (this) {
if (!hasBeenEnded) {
logger.log(Level.SEVERE, "Span " + name + " is GC'ed without being ended.");
}
}
super.finalize();
}
}

0 comments on commit 48816c8

Please sign in to comment.