Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(module:code-editor): resolve memory leak #6846

Merged
merged 1 commit into from
Jul 12, 2021

Conversation

arturovt
Copy link
Member

@arturovt arturovt commented Jul 12, 2021

PR Checklist

PR Type

[x] Bugfix

What is the current behavior?

I've noticed the NzCodeEditorService cannot be GC'd since it subscribes configUpdated$ which is a subject and keeps subscribers in its observers property until it's teardowned. This creates a memory leak for server-side rendered applications since the NzCodeEditorService is created and destroyed there per each HTTP request.

image

What is the new behavior?

The NzCodeEditorService is GC'd successfully.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

@zorro-bot
Copy link

zorro-bot bot commented Jul 12, 2021

This preview will be available after the AzureCI is passed.

@codecov
Copy link

codecov bot commented Jul 12, 2021

Codecov Report

Merging #6846 (b13ff2c) into master (29d44af) will decrease coverage by 0.01%.
The diff coverage is 20.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6846      +/-   ##
==========================================
- Coverage   89.55%   89.53%   -0.02%     
==========================================
  Files         489      489              
  Lines       15796    15799       +3     
  Branches     2427     2427              
==========================================
  Hits        14146    14146              
- Misses       1008     1011       +3     
  Partials      642      642              
Impacted Files Coverage Δ
components/code-editor/code-editor.service.ts 18.30% <20.00%> (-0.81%) ⬇️
components/tabs/tab-nav-bar.component.ts 83.03% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 29d44af...b13ff2c. Read the comment docs.

Copy link
Member

@hsuanxyz hsuanxyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hsuanxyz hsuanxyz merged commit 6d43b6c into NG-ZORRO:master Jul 12, 2021
@arturovt arturovt deleted the fix/editor-service-leak branch July 12, 2021 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants