You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Tsz-wo Sze (Jira)" <ji...@apache.org> on 2023/09/16 22:06:00 UTC
[jira] [Commented] (HDDS-9295) Avoid overriding finalize() in CodecBuffer
[ https://issues.apache.org/jira/browse/HDDS-9295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17766025#comment-17766025 ]
Tsz-wo Sze commented on HDDS-9295:
----------------------------------
A reference is HDFS-8562 which has a similar problem:
bq. ... with jdk8 update 40 and G1 collector, we saw datanode GC pauses spiked toward 160 milliseconds while they should be around 20 milliseconds.
The reason is that
bq. When a class that has a finalizer created, an entry for that class instance is put on a queue in the JVM so the JVM knows it has a finalizer that needs to be executed.
See also https://stackoverflow.com/questions/2860121/why-do-finalizers-have-a-severe-performance-penalty
{quote}
Effective Java says :
There is a severe performance penalty for using finalizers.
{quote}
> Avoid overriding finalize() in CodecBuffer
> ------------------------------------------
>
> Key: HDDS-9295
> URL: https://issues.apache.org/jira/browse/HDDS-9295
> Project: Apache Ozone
> Issue Type: Improvement
> Components: db
> Reporter: Tsz-wo Sze
> Assignee: Tsz-wo Sze
> Priority: Major
> Labels: pull-request-available
>
> CodecBuffer overrides the finalize() method for leak detection. It turns out causing a much longer GC time. (Thanks [~duongnguyen] for finding it out.)
> This JIRA is to change CodecBuffer not to override finalize(). In the test, we will create a subclass to override CodecBuffer for leak detection.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org