Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

[fix] Memory leak of the map in ThreadLocalAccessor #2006

Conversation

BewareMyPower
Copy link
Collaborator

Fix: #1956

Modifications

Update stats on the netty threads to fix the stats memory leak issue.

The root cause is we can only use DataSketchesOpStatsLogger in the netty thread. When used in other threads, it will cause memory leak, since the FastThreadLocal can't remove the map if the thread is not netty thread.

Documentation

Check the box below.

Need to update docs?

  • doc-required

    (If you need help on updating docs, create a doc issue)

  • no-need-doc

    (Please explain why)

  • doc

    (If this PR contains doc changes)

Fix: streamnative#1956

### Modifications
Update stats on the netty threads to fix the stats memory leak issue.

The root cause is we can only use `DataSketchesOpStatsLogger` in the netty thread.
When used in other threads, it will cause memory leak, since the `FastThreadLocal` can't remove the map if the thread is not netty thread.
@BewareMyPower BewareMyPower self-assigned this Sep 20, 2023
@github-actions github-actions bot added the no-need-doc This pr does not need any document label Sep 20, 2023
@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

Merging #2006 (c7e3749) into master (9ab8411) will decrease coverage by 0.09%.
The diff coverage is 3.29%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2006      +/-   ##
============================================
- Coverage     17.06%   16.98%   -0.09%     
+ Complexity      731      730       -1     
============================================
  Files           191      191              
  Lines         14277    14307      +30     
  Branches       1340     1339       -1     
============================================
- Hits           2437     2430       -7     
- Misses        11663    11701      +38     
+ Partials        177      176       -1     
Files Changed Coverage Δ
...ative/pulsar/handlers/kop/MessageFetchContext.java 0.00% <0.00%> (ø)
...ative/pulsar/handlers/kop/format/DecodeResult.java 0.00% <0.00%> (ø)
...ative/pulsar/handlers/kop/format/EncodeResult.java 31.81% <0.00%> (-5.03%) ⬇️
...sar/handlers/kop/storage/AppendRecordsContext.java 0.00% <0.00%> (ø)
...lsar/handlers/kop/storage/PartitionLogManager.java 0.00% <ø> (ø)
...ve/pulsar/handlers/kop/storage/ReplicaManager.java 0.00% <0.00%> (ø)
...tive/pulsar/handlers/kop/storage/PartitionLog.java 8.15% <3.63%> (-0.20%) ⬇️
...ative/pulsar/handlers/kop/PendingTopicFutures.java 87.17% <100.00%> (+9.40%) ⬆️

@BewareMyPower BewareMyPower merged commit 014340d into streamnative:master Sep 20, 2023
20 of 22 checks passed
BewareMyPower pushed a commit that referenced this pull request Oct 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
no-need-doc This pr does not need any document type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Memory leak of the map in ThreadLocalAccessor
2 participants