Skip to content

fix(runtime-core): remove all blocks related to the current instance to avoid memory leaks in ssr #3106

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

Closed
wants to merge 1 commit into from

Conversation

HcySunYang
Copy link
Member

close: #3100

@HcySunYang
Copy link
Member Author

HcySunYang commented Jan 27, 2021

I created a new project based on the project provided by @aprilcai, which provides four heap memory snapshots:

And, you can directly load these snapshots into chrome and analyze memory leaks, u can also execute the following two commands to generate a snapshot locally:

yarn heapdump-leak
yarn heapdump-healthy

My analysis result is:

image

@LinusBorg
Copy link
Member

@HcySunYang which priority label is this? More of a common situation or an edge case?

@HcySunYang HcySunYang added the 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. label Feb 4, 2021
@HcySunYang
Copy link
Member Author

I think it's an edge case because it only occurs when rendering errors

@yyx990803
Copy link
Member

Actually, since there can never be nested renderComponentRoot calls, we can just always reset blockStack when there's a render error. See da944cb

@yyx990803 yyx990803 closed this Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope: ssr
Projects
None yet
Development

Successfully merging this pull request may close these issues.

seems like memory leak in ssr when runtime-core throw an error
3 participants