szetszwo commented on PR #6234:
URL: https://github.com/apache/ozone/pull/6234#issuecomment-1967263586

   However, the code before this pr is ineffective since the `ThreadLocal`  
variable `omLockDetails` in `OMClientRequest` is non-static.  Then, a new 
`ThreadLocal` will be allocated when creating a new `OMClientRequest` object, 
and the `ThreadLocal` will be garbage collected when the `OMClientRequest` 
object is unreachable.
   
   The intention of using `ThreadLocal` probably was to reuse the same 
`omLockDetails` object across different `OMClientRequest` objects.  As 
described above, since the `ThreadLocal` was non-static, the `omLockDetails` 
object was never reused.
   
   Although this pr did not fix memory leak (since there was no leakage), it 
did reduce memory usage and improve performance since it has avoided the 
`ThreadLocal` overhead.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to