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:icon): resolve memory leak #6839

Merged
merged 1 commit into from
Jul 12, 2021

Conversation

arturovt
Copy link
Member

PR Checklist

PR Type

[x] Bugfix

What is the current behavior?

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

image

What is the new behavior?

The NzIconService is GC'd successfully.

Does this PR introduce a breaking change?

[x] No

@arturovt arturovt requested a review from wzhudev as a code owner July 11, 2021 20:38
@zorro-bot
Copy link

zorro-bot bot commented Jul 11, 2021

This preview will be available after the AzureCI is passed.

@codecov
Copy link

codecov bot commented Jul 11, 2021

Codecov Report

Merging #6839 (197efaa) into master (3267571) will decrease coverage by 0.05%.
The diff coverage is 57.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6839      +/-   ##
==========================================
- Coverage   89.58%   89.53%   -0.06%     
==========================================
  Files         489      489              
  Lines       15790    15795       +5     
  Branches     2425     2426       +1     
==========================================
- Hits        14146    14142       -4     
- Misses       1003     1009       +6     
- Partials      641      644       +3     
Impacted Files Coverage Δ
components/icon/icon.service.ts 92.42% <57.14%> (-4.30%) ⬇️
components/core/util/text-measure.ts 89.56% <0.00%> (-1.74%) ⬇️
components/tabs/tab-nav-bar.component.ts 82.33% <0.00%> (-1.42%) ⬇️

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 3267571...197efaa. Read the comment docs.

Copy link
Member

@wzhudev wzhudev left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@hsuanxyz hsuanxyz merged commit bdc2a55 into NG-ZORRO:master Jul 12, 2021
@arturovt arturovt deleted the fix/icon-service-leak branch July 12, 2021 08:42
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.

3 participants