[
https://issues.apache.org/jira/browse/HDDS-10385?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17819128#comment-17819128
]
Attila Doroszlai commented on HDDS-10385:
-----------------------------------------
[~Symious], I would guess {{OzoneManagerLock}} benefits from using
{{ThreadLocal}}, instead of creating new {{OMLockDetails}} for each
{{acquire...}} call, since it is a global object. However, one instance per
{{OMClientRequest}} introduces fewer objects and may not have the same effect.
Checking individual commits in the [original
PR|https://github.com/apache/ozone/pull/5020], I assume by "first version" you
mean the code without any {{ThreadLocal}}. But this change keeps
{{ThreadLocal}} in {{OzoneManagerLock}}.
> Memory leak for thread local usages in OMClientRequest
> ------------------------------------------------------
>
> Key: HDDS-10385
> URL: https://issues.apache.org/jira/browse/HDDS-10385
> Project: Apache Ozone
> Issue Type: Bug
> Components: Ozone Manager
> Reporter: Sumit Agrawal
> Assignee: Sumit Agrawal
> Priority: Critical
> Labels: pull-request-available
> Fix For: 1.5.0
>
>
> As part of *HDDS-8974. Introduce detailed lock information*
> Below omLockDetails is declared which is private to the instance and consume
> thread local resource of thread. But this resource is never released.
> private final ThreadLocal<OMLockDetails> omLockDetails =
> ThreadLocal.withInitial(OMLockDetails::new);
>
> This will cause memory leak and thread local memory keeps increasing with
> each new Request object.
>
> Need avoid usages of thread local as instance level; or need use as static or
> as singleton to reuse same resource.
>
> cc: [~Symious] [~Sammi]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]