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

[Bug Report][3.3.10] Version 3.3.10 still has memory leaks during ssr in nuxt #17917

Closed
Nisekoi5 opened this issue Jul 30, 2023 · 3 comments · Fixed by #17934
Closed

[Bug Report][3.3.10] Version 3.3.10 still has memory leaks during ssr in nuxt #17917

Nisekoi5 opened this issue Jul 30, 2023 · 3 comments · Fixed by #17934
Assignees
Labels
E: theme Theme composable NUXT NUXT related issues T: bug Functionality that does not work as intended/expected
Milestone

Comments

@Nisekoi5
Copy link

Environment

Vuetify Version: 3.3.10
Vue Version: 3.3.4
Browsers: Chrome 115.0.0.0
OS: Windows 10

Steps to reproduce

node version v18.17.0

Run debugging after building with the script's build command

node --inspect=9229 . \.output\server\index.mjs

Print a snapshot of the heap once
Visit the page 1K times using the stress test tool
Reprint snapshot after clicking garbage collection
I get the following result about 30M memory is occupied and can't be freed.
The memory contains a lot of string objects with duplicate component styles and some arrays.

m1
m3

Expected Behavior

Memory is being garbage collected normally

Actual Behavior

A lot of memory was not freed

Reproduction Link

https://github.com/Nisekoi5/vuetify-memory-issues

Other comments

I noticed that this is an issue that has already been raised
#16156
And saw the instructions for fixing it in 3.3.8
d2bdc7f
But I'm still getting memory not being freed, is this expected?

@tobiasklemp
Copy link
Contributor

I finally found a fix for this and created a PR. The main problem is that watchers which are created in a nuxt context cannot be unwatched automagically by vue, so we need to unwatch manually or just watch it on client side since watcher are not run on server anyway.

@Nisekoi5
Copy link
Author

Nisekoi5 commented Aug 1, 2023

I finally found a fix for this and created a PR. The main problem is that watchers which are created in a nuxt context cannot be unwatched automagically by vue, so we need to unwatch manually or just watch it on client side since watcher are not run on server anyway.

This PR worked great on my code, mine made 4000+ accesses and the unfreed strings and arrays no longer appear!
Thanks for the PR!
Hopefully the repository maintainer will check if this might be causing other problems!

@johnleider johnleider self-assigned this Aug 1, 2023
@johnleider johnleider added T: bug Functionality that does not work as intended/expected NUXT NUXT related issues E: theme Theme composable and removed S: triage labels Aug 1, 2023
@johnleider johnleider added this to the v3.3.x milestone Aug 1, 2023
@memic84
Copy link

memic84 commented Oct 2, 2023

@tobiasklemp we are running the latest version, but still get the same result. Exactly the same data as in your screenshots. Memory goes up very fast, and we have excluded all other plugins/code.

Possible the problem persists somewhere else?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E: theme Theme composable NUXT NUXT related issues T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants