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:core): resolve memory leak #6852

Merged
merged 1 commit into from
Oct 28, 2021

Conversation

arturovt
Copy link
Member

PR Checklist

PR Type

[x] Bugfix

What is the current behavior?

I've noticed the NzResizeService cannot be GC'd since it has the handler instance property which captures this. This creates a memory leak for server-side rendered applications since the NzResizeService is created and destroyed there per each HTTP request:

image

What is the new behavior?

The NzResizeService is GC'd successfully.

Does this PR introduce a breaking change?

[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 #6852 (82ed713) into master (f89cb38) will decrease coverage by 0.03%.
The diff coverage is 33.33%.

❗ Current head 82ed713 differs from pull request most recent head e1dffc4. Consider uploading reports for the commit e1dffc4 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6852      +/-   ##
==========================================
- Coverage   89.52%   89.48%   -0.04%     
==========================================
  Files         489      489              
  Lines       15802    15804       +2     
  Branches     2572     2572              
==========================================
- Hits        14146    14142       -4     
- Misses       1015     1019       +4     
- Partials      641      643       +2     
Impacted Files Coverage Δ
components/core/services/resize.ts 85.71% <33.33%> (-6.60%) ⬇️
components/core/util/text-measure.ts 89.56% <0.00%> (-1.74%) ⬇️
components/time-picker/time-holder.ts 94.73% <0.00%> (-1.06%) ⬇️
components/tabs/tab-nav-bar.component.ts 82.33% <0.00%> (-0.71%) ⬇️
components/modal/modal-container.ts 92.89% <0.00%> (+0.54%) ⬆️

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 f89cb38...e1dffc4. Read the comment docs.

Copy link
Member

@simplejason simplejason left a comment

Choose a reason for hiding this comment

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

LGTM

@simplejason simplejason merged commit 25eb0fe into NG-ZORRO:master Oct 28, 2021
@arturovt arturovt deleted the fix/core-resize-leak branch October 30, 2021 18:00
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