[ 
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to