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

Small memory leak inside trackWebVitalMetric #32631

Closed
westn opened this issue Dec 18, 2021 · 1 comment · Fixed by #33867
Closed

Small memory leak inside trackWebVitalMetric #32631

westn opened this issue Dec 18, 2021 · 1 comment · Fixed by #33867
Assignees

Comments

@westn
Copy link

westn commented Dec 18, 2021

What version of Next.js are you using?

12.0.7

What version of Node.js are you using?

16.4.2

What browser are you using?

Chrome

What operating system are you using?

macOS

How are you deploying your application?

next start

Describe the Bug

In next/client/vitals.ts there's a function trackWebVitalMetric which gets called on each navigation that will push a metric object onto the metrics-array. This causes a small memory leak, especially since this array is only used by an experimental hook useExperimentalWebVitalsReport.

Expected Behavior

A) That the application doesn't contain any sudden memory leak
B) It would be good with an option that doesn't include experimental features

To Reproduce

  1. Have an example with at least a start page and a linked page
  2. Navigate between the pages by using e.g., NextLink or use the browser back button
  3. Note how the variable metrics will grow for each navigation
@westn westn added the bug Issue was opened via the bug report template. label Dec 18, 2021
@huozhi huozhi self-assigned this Dec 18, 2021
@balazsorban44 balazsorban44 added kind: bug and removed bug Issue was opened via the bug report template. labels Dec 18, 2021
@kodiakhq kodiakhq bot closed this as completed in #33867 Feb 1, 2022
kodiakhq bot pushed a commit that referenced this issue Feb 1, 2022
## Bug

fixes #32631

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`
natew pushed a commit to natew/next.js that referenced this issue Feb 16, 2022
## Bug

fixes vercel#32631

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2022

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants