question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

memory leak with `useHead`

See original GitHub issue

Environment

Netlify lambda

Reproduction

https://github.com/Rigo-m/bridge-nitro-generate-sourcemaps -> Bridge https://github.com/atoms-studio/netlify-odb-cache -> Nuxt3

  1. create a netlify site for each
  2. take a peek at function/server log
  3. hit some random slugs to generate pages via on demand builder (e.g.: your-netlify-handle.netlify.app/1, your-netlify-hande.netlify.app/2

Describe the bug

Nuxt3 is better than bridge, but it seems like there is some sort of memory leak. Lambda’s memory keeps raising every time you invoke a new web page (already invoked ones are cached via on demand builders). In a big website we’ve made with bridge, lambda crashes every once in a while because of memory impairments.

Here’s a log example: https://pastebin.com/bsY1bpwf

Additional context

No response

Logs

https://pastebin.com/bsY1bpwf

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
Jackliu007888commented, Apr 8, 2022

我也遇到内存泄露 在alinode排查时发现 allHeadObjs 这个可疑点

https://github.com/vueuse/head/issues/36 这个好像也是相似的错误

image image

1reaction
Jackliu007888commented, Apr 19, 2022

@Rigo-m @danielroe I have a memory leak problem, through alinode monitoring, get the HeapSnapshot file, analysis found that “Set” object and “ReactiveEffect” object can be suspicious. image image

Heapsnapshot analysis shows that there are many ”meta2“

Here does not need to use ref ? image image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nuxt 3: SSR memory leak in `useHead()` with computed getter ...
Computed getter in useHead() from nuxt-hedge. Production build of an application, 60 requests per second, 10 minutes of load (36 000 requests).
Read more >
Memory leak: How to avoid it in Vue js - ArrowHiTech
Memory leaks in Vue applications do not typically come from Vue itself, rather they can happen when incorporating other libraries into an application....
Read more >
LeakDetect: Free Memory Leak Detection Tool - uberAgent
Today is such a happy day: we proudly announce LeakDetect, a new Windows memory instrumentation tool that helps detect memory leaks in ...
Read more >
@nuxt/bridge-edge - npm
Nuxt Bridge provides a new Nuxt 3 meta API that can be accessed with a new useHead composable. ... This useHead composable uses...
Read more >
250226 – graphics/drm-fbsd12.0-kmod: massive memory leak
Bug 250226 - graphics/drm-fbsd12.0-kmod: massive memory leak ... (In reply to Scott Bennett from comment #1) I use HEAD and vm_max_wired no longer...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found